From 0793d0b6390bb206dabc42ff2e021d0b505aa0c5 Mon Sep 17 00:00:00 2001 From: Pietro Bolcato Date: Wed, 20 Sep 2023 20:59:04 +0200 Subject: [PATCH 01/16] Add CI workflow --- .github/workflows/ci.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b17c877 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,29 @@ +name: ci +on: [push, pull_request] + +jobs: + ci: + name: CI + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v2 + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: eu-central-1 + - name: Set up Python 3.11 + uses: actions/setup-python@v2 + with: + python-version: 3.11 + - name: Set up `dev` conda environment + uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: dev + environment-file: envs/dev.yaml + auto-activate-base: false + - name: Run tests + run: | + python -m pytest vectorizing/tests/test.py \ No newline at end of file From 946388cf7a334729b447186e71778bf5eea5bdbe Mon Sep 17 00:00:00 2001 From: Pietro Bolcato Date: Wed, 20 Sep 2023 21:02:15 +0200 Subject: [PATCH 02/16] Add system dependencies to CI --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b17c877..2ea82cc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,10 @@ jobs: uses: actions/setup-python@v2 with: python-version: 3.11 + - name: Set up system dependencies + run: | + sudo apt-get update + sudo apt-get install -y build-essential python-dev libagg-dev libpotrace-dev pkg-config libffi-dev libcairo2-dev - name: Set up `dev` conda environment uses: conda-incubator/setup-miniconda@v2 with: From 2a010d7374ba9ff8488ba080e9273093d67d5db9 Mon Sep 17 00:00:00 2001 From: Pietro Bolcato Date: Wed, 20 Sep 2023 21:05:16 +0200 Subject: [PATCH 03/16] Fix system dependencies install --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ea82cc..d99cd7b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: - name: Set up system dependencies run: | sudo apt-get update - sudo apt-get install -y build-essential python-dev libagg-dev libpotrace-dev pkg-config libffi-dev libcairo2-dev + # sudo apt-get install -y build-essential python-dev libagg-dev libpotrace-dev pkg-config libffi-dev libcairo2-dev - name: Set up `dev` conda environment uses: conda-incubator/setup-miniconda@v2 with: From b319563c23fa12b132ae6fa0752fb0c45894cfd2 Mon Sep 17 00:00:00 2001 From: Pietro Bolcato Date: Wed, 20 Sep 2023 21:06:13 +0200 Subject: [PATCH 04/16] Fix system dependencies --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d99cd7b..1b127a7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: - name: Set up system dependencies run: | sudo apt-get update - # sudo apt-get install -y build-essential python-dev libagg-dev libpotrace-dev pkg-config libffi-dev libcairo2-dev + sudo apt-get install -y build-essential libagg-dev libpotrace-dev pkg-config libffi-dev libcairo2-dev - name: Set up `dev` conda environment uses: conda-incubator/setup-miniconda@v2 with: From 4703c62d2d7c68ac9352153820b08301922321b8 Mon Sep 17 00:00:00 2001 From: Pietro Bolcato Date: Wed, 20 Sep 2023 21:09:48 +0200 Subject: [PATCH 05/16] Add conda activate to CI --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b127a7..0f67705 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,4 +30,5 @@ jobs: auto-activate-base: false - name: Run tests run: | + conda activate dev python -m pytest vectorizing/tests/test.py \ No newline at end of file From 55149b1c3d3731c7a8ca09321cf8e315ba7bd3d2 Mon Sep 17 00:00:00 2001 From: Pietro Bolcato Date: Wed, 20 Sep 2023 21:14:35 +0200 Subject: [PATCH 06/16] Add shell information to CI --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0f67705..31132f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,12 +23,14 @@ jobs: sudo apt-get update sudo apt-get install -y build-essential libagg-dev libpotrace-dev pkg-config libffi-dev libcairo2-dev - name: Set up `dev` conda environment + shell: bash uses: conda-incubator/setup-miniconda@v2 with: activate-environment: dev environment-file: envs/dev.yaml auto-activate-base: false - name: Run tests + shell: bash run: | conda activate dev python -m pytest vectorizing/tests/test.py \ No newline at end of file From 61eee468591e7b26de9e0892af0c79007c532836 Mon Sep 17 00:00:00 2001 From: Pietro Bolcato Date: Wed, 20 Sep 2023 21:15:09 +0200 Subject: [PATCH 07/16] Fix shell on CI --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 31132f0..88c4eca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,6 @@ jobs: sudo apt-get update sudo apt-get install -y build-essential libagg-dev libpotrace-dev pkg-config libffi-dev libcairo2-dev - name: Set up `dev` conda environment - shell: bash uses: conda-incubator/setup-miniconda@v2 with: activate-environment: dev From bf557ffb2b39c2c4011c728500ddac8635cf423a Mon Sep 17 00:00:00 2001 From: Pietro Bolcato Date: Wed, 20 Sep 2023 21:18:08 +0200 Subject: [PATCH 08/16] Update shell info on CI --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 88c4eca..7ee51a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,8 @@ jobs: environment-file: envs/dev.yaml auto-activate-base: false - name: Run tests - shell: bash + shell: bash -el {0} run: | + conda info conda activate dev python -m pytest vectorizing/tests/test.py \ No newline at end of file From 1b02c0d24791067dcc825bec07e51cebcab9c67a Mon Sep 17 00:00:00 2001 From: Pietro Bolcato Date: Wed, 20 Sep 2023 21:26:30 +0200 Subject: [PATCH 09/16] Add env variables to CI --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ee51a8..435e715 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,12 @@ jobs: ci: name: CI runs-on: ubuntu-latest + env: + PORT: "8000" + S3_BUCKET: "-" + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + S3_TEST_BUCKET: ${{ secrets.S3_TEST_BUCKET }} steps: - name: Check out repository code uses: actions/checkout@v2 From 72a36b63e1ff0fd76c498127bbece6ac30eef688 Mon Sep 17 00:00:00 2001 From: Pietro Bolcato Date: Wed, 20 Sep 2023 21:29:10 +0200 Subject: [PATCH 10/16] Remove unused 'conda info' in CI --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 435e715..511c867 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,6 +37,5 @@ jobs: - name: Run tests shell: bash -el {0} run: | - conda info conda activate dev python -m pytest vectorizing/tests/test.py \ No newline at end of file From 2fba01a7553836e93892215b2d186f6c155ee881 Mon Sep 17 00:00:00 2001 From: Pietro Bolcato Date: Wed, 20 Sep 2023 21:30:48 +0200 Subject: [PATCH 11/16] Add system dependencies installer in shared bash script --- .github/workflows/ci.yml | 3 +-- scripts/install_system_deps.sh | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 scripts/install_system_deps.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 511c867..8dc9a33 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,8 +26,7 @@ jobs: python-version: 3.11 - name: Set up system dependencies run: | - sudo apt-get update - sudo apt-get install -y build-essential libagg-dev libpotrace-dev pkg-config libffi-dev libcairo2-dev + bash scripts/install_system_deps.sh - name: Set up `dev` conda environment uses: conda-incubator/setup-miniconda@v2 with: diff --git a/scripts/install_system_deps.sh b/scripts/install_system_deps.sh new file mode 100644 index 0000000..e2af648 --- /dev/null +++ b/scripts/install_system_deps.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# this script install system dependencies for vectorizing + +sudo apt-get update +sudo apt-get install -y build-essential python-dev libagg-dev libpotrace-dev pkg-config libffi-dev libcairo2-dev From 969be0591fa3060d96238fb3952004c13b634a12 Mon Sep 17 00:00:00 2001 From: Pietro Bolcato Date: Wed, 20 Sep 2023 21:32:12 +0200 Subject: [PATCH 12/16] Refactor system dependencies script file name --- .github/workflows/ci.yml | 2 +- scripts/install_system_dependencies.sh | 5 +++++ scripts/install_system_deps.sh | 5 ----- 3 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 scripts/install_system_dependencies.sh delete mode 100644 scripts/install_system_deps.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8dc9a33..a21128f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: python-version: 3.11 - name: Set up system dependencies run: | - bash scripts/install_system_deps.sh + bash scripts/install_system_dependencies.sh - name: Set up `dev` conda environment uses: conda-incubator/setup-miniconda@v2 with: diff --git a/scripts/install_system_dependencies.sh b/scripts/install_system_dependencies.sh new file mode 100644 index 0000000..05551bf --- /dev/null +++ b/scripts/install_system_dependencies.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# this script install system dependencies for vectorizing + +sudo apt-get update +sudo apt-get install -y build-essential libagg-dev libpotrace-dev pkg-config libffi-dev libcairo2-dev diff --git a/scripts/install_system_deps.sh b/scripts/install_system_deps.sh deleted file mode 100644 index e2af648..0000000 --- a/scripts/install_system_deps.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -# this script install system dependencies for vectorizing - -sudo apt-get update -sudo apt-get install -y build-essential python-dev libagg-dev libpotrace-dev pkg-config libffi-dev libcairo2-dev From fefcafb5a6b06d59339ee45a296f22a97d25d222 Mon Sep 17 00:00:00 2001 From: Pietro Bolcato Date: Wed, 20 Sep 2023 21:40:48 +0200 Subject: [PATCH 13/16] Update post_create.sh script to use shared system deps installer script --- .devcontainer/scripts/post_create.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.devcontainer/scripts/post_create.sh b/.devcontainer/scripts/post_create.sh index ed5c418..3de5787 100644 --- a/.devcontainer/scripts/post_create.sh +++ b/.devcontainer/scripts/post_create.sh @@ -1,7 +1,11 @@ #!/bin/bash # this script install system dependencies for vectorizing and sets up conda -sudo apt-get update -sudo apt-get install -y build-essential python-dev libagg-dev libpotrace-dev pkg-config libffi-dev libcairo2-dev +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +# install system dependencies +bash "$SCRIPT_DIR"/../../scripts/install_system_dependencies.sh + +# setup conda conda env create -n dev -f envs/dev.yaml conda init \ No newline at end of file From dbe7940200cce0f1a1728c286af7b417f944407a Mon Sep 17 00:00:00 2001 From: Pietro Bolcato Date: Wed, 20 Sep 2023 21:40:54 +0200 Subject: [PATCH 14/16] Update README documentation --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index ecf0c88..1744134 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,8 @@ The first time the execution can take few minutes, as it is pulling the dev cont bash scripts/compile_envs.sh ``` +4. If you want to add or remove **system** dependencies, update the script: [`scripts/install_system_dependencies.sh`](scripts/install_system_dependencies.sh). This is used both in CI and at dev container creation, to keep them consistent. + This will compile dependencies and environments, ensuring a consistent development workflow and deployment. ## Server From 11e6defee84527c482430830905a29bc58cdcb3e Mon Sep 17 00:00:00 2001 From: Pietro Bolcato Date: Wed, 20 Sep 2023 21:43:54 +0200 Subject: [PATCH 15/16] Fix typo in README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1744134..f03db7f 100644 --- a/README.md +++ b/README.md @@ -28,10 +28,10 @@ The first time the execution can take few minutes, as it is pulling the dev cont bash scripts/compile_envs.sh ``` -4. If you want to add or remove **system** dependencies, update the script: [`scripts/install_system_dependencies.sh`](scripts/install_system_dependencies.sh). This is used both in CI and at dev container creation, to keep them consistent. - This will compile dependencies and environments, ensuring a consistent development workflow and deployment. +4. If you want to add or remove **system** dependencies, update the script: [`scripts/install_system_dependencies.sh`](scripts/install_system_dependencies.sh). This is used both in CI and at dev container creation, to keep them consistent. + ## Server The server has a single endpoint that receives `POST` requests. From 7e907f6e6a2cddd60a29460ad87591f9971e78fa Mon Sep 17 00:00:00 2001 From: Pietro Bolcato Date: Wed, 20 Sep 2023 21:44:31 +0200 Subject: [PATCH 16/16] Fix formatting in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f03db7f..a465d66 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ The first time the execution can take few minutes, as it is pulling the dev cont bash scripts/compile_envs.sh ``` -This will compile dependencies and environments, ensuring a consistent development workflow and deployment. + This will compile dependencies and environments, ensuring a consistent development workflow and deployment. 4. If you want to add or remove **system** dependencies, update the script: [`scripts/install_system_dependencies.sh`](scripts/install_system_dependencies.sh). This is used both in CI and at dev container creation, to keep them consistent.