From 2031f4453e9668248da2a33b5935100a43206f27 Mon Sep 17 00:00:00 2001 From: Eve-ning Date: Wed, 22 Nov 2023 14:38:32 +0800 Subject: [PATCH 1/5] Mount __w Python --- .github/workflows/model.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/model.yml b/.github/workflows/model.yml index fdc56654..fab540a7 100644 --- a/.github/workflows/model.yml +++ b/.github/workflows/model.yml @@ -10,7 +10,7 @@ jobs: container: image: docker://ghcr.io/iterative/cml:0-dvc2-base1-gpu volumes: - - /home/runner/work/_temp/_github_home:/root + - /home/runner/work/frdc-ml/Python:/__w/_tool/Python steps: - uses: actions/checkout@v3 From 02b540d5d6dffb7417c02ccd17d35f874f12d31f Mon Sep 17 00:00:00 2001 From: Eve-ning Date: Wed, 22 Nov 2023 14:52:21 +0800 Subject: [PATCH 2/5] Try using container env for caching --- .env | 2 -- .github/workflows/model.yml | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 .env diff --git a/.env b/.env deleted file mode 100644 index 4f03e6b2..00000000 --- a/.env +++ /dev/null @@ -1,2 +0,0 @@ -# This helps gh-actions setup a cached venv -AGENT_TOOLSDIRECTORY=/root/venv diff --git a/.github/workflows/model.yml b/.github/workflows/model.yml index fab540a7..2564c80a 100644 --- a/.github/workflows/model.yml +++ b/.github/workflows/model.yml @@ -11,6 +11,8 @@ jobs: image: docker://ghcr.io/iterative/cml:0-dvc2-base1-gpu volumes: - /home/runner/work/frdc-ml/Python:/__w/_tool/Python + env: + AGENT_TOOLSDIRECTORY: "/root/venv" steps: - uses: actions/checkout@v3 From 5af0e49bb592801de6f4eb5627f6d3941286e570 Mon Sep 17 00:00:00 2001 From: Eve-ning Date: Wed, 22 Nov 2023 14:55:18 +0800 Subject: [PATCH 3/5] Mount root as volume --- .github/workflows/model.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/model.yml b/.github/workflows/model.yml index 2564c80a..e1a6f6f0 100644 --- a/.github/workflows/model.yml +++ b/.github/workflows/model.yml @@ -10,7 +10,7 @@ jobs: container: image: docker://ghcr.io/iterative/cml:0-dvc2-base1-gpu volumes: - - /home/runner/work/frdc-ml/Python:/__w/_tool/Python + - /home/runner/work/frdc-ml/_github_home:/root env: AGENT_TOOLSDIRECTORY: "/root/venv" From b886c3e47ab99e386afbbb1d9e57c139c49aba9d Mon Sep 17 00:00:00 2001 From: Eve-ning Date: Wed, 22 Nov 2023 15:09:56 +0800 Subject: [PATCH 4/5] Remove internal gh caching --- .github/workflows/model.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/model.yml b/.github/workflows/model.yml index e1a6f6f0..765fd76f 100644 --- a/.github/workflows/model.yml +++ b/.github/workflows/model.yml @@ -24,7 +24,6 @@ jobs: uses: actions/setup-python@v4 with: python-version: "3.11" - cache: 'pip' - name: Install via exported requirements.txt run: | From 130cb5c872a5c5010fdf9c82091b6c90e09dbb74 Mon Sep 17 00:00:00 2001 From: Eve-ning Date: Wed, 22 Nov 2023 15:18:02 +0800 Subject: [PATCH 5/5] Cleanup workflow for merge --- .github/workflows/model.yml | 5 +++-- .github/workflows/python-package.yml | 15 ++++----------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/workflows/model.yml b/.github/workflows/model.yml index 765fd76f..902848da 100644 --- a/.github/workflows/model.yml +++ b/.github/workflows/model.yml @@ -20,6 +20,7 @@ jobs: - name: Force change owner run: | chown -R root: ~ + - name: Set up Python 3.11 uses: actions/setup-python@v4 with: @@ -31,7 +32,7 @@ jobs: python -m pip install flake8 pytest poetry poetry export --with dev --without-hashes -o requirements.txt pip3 install -r requirements.txt - pip3 install torch torchvision torchaudio + pip3 install torch torchvision torchaudio - name: Set up gcloud id: 'auth' @@ -52,7 +53,7 @@ jobs: - name: Run Model Training run: | - python3 -m tests.model_tests.chestnut_dec_may.main + python3 -m tests.model_tests.chestnut_dec_may.main - name: Comment results via CML run: | diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index ac8f5c54..d29a0611 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -1,14 +1,9 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python - name: Python CI on: - workflow_dispatch: - -# push: -# branches: [ "main" ] -# pull_request: + push: + branches: [ "main" ] + pull_request: jobs: build: @@ -36,7 +31,7 @@ jobs: - name: 'Set up Cloud SDK' uses: 'google-github-actions/setup-gcloud@v1' -# We don't necessarily need to install the CUDA version of torch, so we'll do with cpu + # We don't necessarily need to install the CUDA version of torch, so we'll do with cpu - name: Install dependencies run: | python -m pip install --upgrade pip @@ -54,5 +49,3 @@ jobs: - name: Test with pytest run: | pytest - -