From 3a08bf2ebdf73804bcb181674bf7e76f6073c02d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=A9tan=20Ramet?= Date: Mon, 22 Apr 2024 17:09:48 +0200 Subject: [PATCH] Removed unused stuff (#1) --- .github/workflows/ci.yml | 9 ++---- .github/workflows/cml.yml | 63 --------------------------------------- README.md | 20 ------------- src/test/test_sample.py | 6 ---- 4 files changed, 3 insertions(+), 95 deletions(-) delete mode 100644 .github/workflows/cml.yml delete mode 100644 src/test/test_sample.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f8248fc..c2ec6f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,10 +12,7 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: VisiumCH/check-python-style@main + - uses: psf/black@stable with: - python-version: "3.10" - - - name: Test with pytest - run: | - pytest + options: "--check --verbose" + src: "./src" diff --git a/.github/workflows/cml.yml b/.github/workflows/cml.yml deleted file mode 100644 index 8eb4ab4..0000000 --- a/.github/workflows/cml.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: CML - -on: - push: - branches: [main] - workflow_dispatch: - -jobs: - launch-runner: - runs-on: ubuntu-latest - steps: - - uses: iterative/setup-cml@v1 - - uses: actions/checkout@v3 - - name: Deploy runner on Medium instance - env: - # - REPO_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - GOOGLE_APPLICATION_CREDENTIALS_DATA: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_DATA }} - # - run: | - cml runner launch \ - --cloud=gcp \ - --cloud-region=europe-west6-b \ - --cloud-type=m \ - --labels=cml-runner - - train: - needs: launch-runner - runs-on: [self-hosted, cml-runner] - timeout-minutes: 2880 - steps: - - uses: iterative/setup-cml@v1 - - - uses: actions/checkout@v3 - - - id: "auth" - uses: "google-github-actions/auth@v1" - with: - # - credentials_json: "${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_DATA }}" - # - - - name: Set up Python 3.10 - uses: actions/setup-python@v4 - with: - python-version: "3.10" - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install pipenv - pipenv install --dev --system --deploy - - - name: Train model, push data and create PR - env: - # - REPO_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - # - run: | - dvc pull --allow-missing - dvc repro - dvc push - cml pr create . --merge diff --git a/README.md b/README.md index b32a6dd..f5b2307 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ [![CI](https://github.com/VisiumCH/crowd_programming/actions/workflows/ci.yml/badge.svg)](https://github.com/VisiumCH/crowd_programming/actions/workflows/ci.yml) -[![CML](https://github.com/VisiumCH/crowd_programming/actions/workflows/cml.yml/badge.svg)](https://github.com/VisiumCH/crowd_programming/actions/workflows/cml.yml) - # README ## Set up your development environment and run the DVC pipeline @@ -15,23 +13,6 @@ The python environment is managed with `pipenv`. You can set up your environment - Run `gcloud auth` to authenticate to your GCP account. - Finally run `dvc repro` to execute the complete pipeline! You can also execute a single step and its dependencies with `dvc repro `. - -## Set up CML - -For the continuous delivery pipeline to work, you will need to do the following: - -- `PERSONAL_ACCESS_TOKEN`: a github personal access token (PAT) that has write access on your repository. This is necessary to let `cml` merge code in the repo. -- `GOOGLE_APPLICATION_CREDENTIALS_DATA`: a json key authenticating a google service account that has the role `Compute Admin` and `Storage Admin`. -- Set up your github repository to accept auto-merge. This will allow CML to commit the `dvc.lock` after running your pipeline. -- Finally you need to create a bucket and configure the `.dvc/config` file of the project to make it the remote bucket of the project. You can do this with the following command: `dvc remote add -d myremote gs://mybucket`. You can also do this manually by editing the `.dvc/config` file. - - -## Guidelines to follow to make the most out of DVC - -Please refer to this [Notion page](https://www.notion.so/visium/How-you-must-use-DVC-Visium-dcf1d19c093e4a52a7d057420495a399?pvs=4). - - - ## Some tips about pipenv **Deploy in production** @@ -41,4 +22,3 @@ Note that when deploying your code in production, you should not install the dev **Git with pipenv** Make sure to commit the `Pipfile.lock` in `git`. It will make your code more reproducible because other developers could install the exact same python packages as you used. - diff --git a/src/test/test_sample.py b/src/test/test_sample.py deleted file mode 100644 index ec07b22..0000000 --- a/src/test/test_sample.py +++ /dev/null @@ -1,6 +0,0 @@ -"""Module for testing.""" - - -def test_template() -> None: - """Test template.""" - assert 1 + 1 == 2