I also ran it without $(pwd) on the Create Clearml task templates section, I added it because of CostlyOstrich36 's comments but it didn't help
🙂
$(pwd)/tasks/hp_optimization.py
Is this the location of the repository? Or a single, completely standalone file?
working directory is the same relative to the script, but the absolute path is different as the github action creates a new environment for it and deletes it after
I can try do an ls
to see what it will print out
Okay SuccessfulKoala55 , problem solved! Indeed the problem was that there is not .git
folder. I updated necessary things to make the checkout action get the actual repo and now it works
It wasn't really clear to me what "standalone" means, maybe it will be better to add to the error
Error: Standalone
(no .git folder found)
script detected 'tasks/hp_optimization.py', but no requirements provided
SuccessfulKoala55 seems like you got it spot on, it contains the entire repo, but no .git
directory
So what can we do about it? All I want is to create templates for some tasks, so I can later execute them through a Pipelinecontroller
WackyRabbit7 can I see the exact setup when running as a GitHub action? What are the arguments for clearml-task exactly? What is the working directory?
So the question is how come clearml-task can't detect the repo - perhaps the GitHub action checkout doesn't produce a valid for repository and only places the actual files there?
Can you try and specify the exact absolute path? I think that might be the problem.
but when it is executed through github actions, I get this error
anyway, my ultimate goal is to create templates for other tasks... Is that possible in any other way through the CLI?
` name: XXXXXXXXXX
on:
workflow_dispatch
jobs:
test-monthly-predictions:
runs-on: self-hosted
env:
DATA_DIR: ${{ secrets.RUNNER_DATA_DIR }}
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.RUNNER_CREDS }}
steps:
# Checkout
- name: Check out repository code
uses: actions/checkout@v2
# Setup python environment
- name: Setup up python environment using Poetry
run: |
/home/elior/.poetry/bin/poetry env use python3.9
/home/elior/.poetry/bin/poetry install --remove-untracked
# Add the repo to PYTHONPATH
- name: Add repository to PYTHONPATH
run: echo $(pwd) > $(/home/elior/.poetry/bin/poetry run python -c "print('/'.join('$(/home/elior/.poetry/bin/poetry run which python)'.split('/')[:-2]) + '/lib/python3.9/site-packages/XXXXXXXXXXXX.pth')")
# Create ClearML task templates
- name: Create ClearML task templates
run: |
/home/elior/.poetry/bin/poetry run clearml-task --script $(pwd)/tasks/hp_optimization.py --name "XXXXXXXXXXXXXXXXXXX" --project "XXXXXXXXXXXXXXXXXXX"
/home/elior/.poetry/bin/poetry run clearml-task --script $(pwd)/tasks/hpo_n_best_evaluation.py --name "XXXXXXXXXXXXXXXXXXX" --project "XXXXXXXXXXXXXXXXXXX"
/home/elior/.poetry/bin/poetry run clearml-task --script $(pwd)/tasks/data_projection.py --name "XXXXXXXXXXXXXXXXXXX" --project "XXXXXXXXXXXXXXXXXXX"
# Run Monthly predictions for October
- name: Run October's Monthly Predictions
run: /home/elior/.poetry/bin/poetry run python tasks/pipelines/monthly_predictions.py "21-10"
# Run monthly prediction test
- name: Test predictions
run: /home/elior/.poetry/bin/poetry run pytest tests `
SuccessfulKoala55 ⬆ sorry for the delay, was at a meeting
I can't specify the absolute path, it is dynamically created
Github actions allows to use self hosted runners
Cool! Just to explain, it means clearml-task did not detect a repository (indeed it was not a repository, just a folder with files...), and thus could not deduce the requirements. Standalone means "just a single script to run from some file", but it's still not clear to me why, upon deciding this was not a repository, clearml-task failed to analyze the actual file itself
when using the first checkout action, it goes checks out the repo
I executed it now with full path, using $(pwd)
this means that you supply the machine to execute the actions specified