Add environment variable validation to start-agent.sh
This commit is contained in:
10
.gitignore
vendored
Normal file
10
.gitignore
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
# Python-generated files
|
||||
__pycache__/
|
||||
*.py[oc]
|
||||
build/
|
||||
dist/
|
||||
wheels/
|
||||
*.egg-info
|
||||
|
||||
# Virtual environments
|
||||
.venv
|
||||
1
.python-version
Normal file
1
.python-version
Normal file
@@ -0,0 +1 @@
|
||||
3.10
|
||||
7
pyproject.toml
Normal file
7
pyproject.toml
Normal file
@@ -0,0 +1,7 @@
|
||||
[project]
|
||||
name = "cloudbt"
|
||||
version = "0.1.0"
|
||||
description = "Add your description here"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.10"
|
||||
dependencies = []
|
||||
31
scripts/start-kaggle-agent.sh
Normal file
31
scripts/start-kaggle-agent.sh
Normal file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
check_env_var() {
|
||||
if [ -z "${!1// /}" ]; then
|
||||
echo "Error: $1 is not set or is empty"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
check_env_var OSS_ENDPOINT
|
||||
check_env_var OSS_ACCESS_KEY
|
||||
check_env_var OSS_SECRET_KEY
|
||||
check_env_var WORKER_NAME
|
||||
|
||||
WORKING_DIR=/kaggle/working
|
||||
|
||||
pip install git+https://gitea.oopsapi.com/yhydev/myscripts.git prefect_shell freqtrade prefect;
|
||||
freqtrade create-userdir --userdir $WORKING_DIR/user_data;
|
||||
mkdir -p $WORKING_DIR/user_data/data/binance;
|
||||
if [ ! -L $WORKING_DIR/user_data/data/binance/futures ]; then
|
||||
ln -s /kaggle/input/bn-futures/futures $WORKING_DIR/user_data/data/binance/futures;
|
||||
fi;
|
||||
cd $WORKING_DIR;
|
||||
if [ ! -f ~/.local/bin/mc ]; then
|
||||
mkdir -p ~/.local/bin
|
||||
wget https://dl.min.io/aistor/mc/release/linux-amd64/mc -O ~/.local/bin/mc
|
||||
chmod +x ~/.local/bin/mc
|
||||
fi
|
||||
export PATH=$PATH:~/.local/bin
|
||||
mc alias set oss $OSS_ENDPOINT $OSS_ACCESS_KEY $OSS_SECRET_KEY --api S3v4
|
||||
prefect worker start --name $WORKER_NAME --pool freqtrade -l 3
|
||||
Reference in New Issue
Block a user