From 81c1c28c49ca42474cc156d13a60ee3b58cd8481 Mon Sep 17 00:00:00 2001 From: NishaSharma14 Date: Thu, 4 Jan 2024 12:36:36 +0100 Subject: [PATCH 01/12] test: automated build for nmr-cli --- .github/workflows/dev-build.yml | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dev-build.yml b/.github/workflows/dev-build.yml index 0bea825..abd0bff 100644 --- a/.github/workflows/dev-build.yml +++ b/.github/workflows/dev-build.yml @@ -11,12 +11,13 @@ name : Dev Build, Test and Publish on: push: - branches: [development] + branches: [dev-nisha] env: DOCKER_HUB_USERNAME : ${{ secrets.DOCKER_USERNAME }} DOCKER_HUB_PASSWORD : ${{ secrets.DOCKER_PASSWORD }} - REPOSITORY_NAME: nmrkit + NMRKIT_REPOSITORY_NAME: nmrkit + NMR_CLI_REPOSITORY_NAME: nmrkit REPOSITORY_NAMESPACE: nfdi4chem RELEASE_TAG: dev-latest @@ -38,14 +39,26 @@ jobs: username: ${{ env.DOCKER_HUB_USERNAME }} password: ${{ env.DOCKER_HUB_PASSWORD }} - - name: Build and push Docker image + # - name: Build and push nmrKit Docker image + # uses: docker/build-push-action@v4 + # with: + # context: . + # file: ./Dockerfile + # push: true + # build-args: | + # RELEASE_VERSION=dev-latest + # tags: ${{ env.REPOSITORY_NAMESPACE }}/${{ env.NMRKIT_REPOSITORY_NAME }}:${{ env.RELEASE_TAG }} + # username: ${{ env.DOCKER_HUB_USERNAME }} + # password: ${{ env.DOCKER_HUB_PASSWORD }} + + - name: Build and push nmr-cli Docker image uses: docker/build-push-action@v4 with: - context: . + context: ./app/scripts/nmr-cli file: ./Dockerfile push: true build-args: | RELEASE_VERSION=dev-latest - tags: ${{ env.REPOSITORY_NAMESPACE }}/${{ env.REPOSITORY_NAME }}:${{ env.RELEASE_TAG }} + tags: ${{ env.REPOSITORY_NAMESPACE }}/${{ env.NMR_CLI_REPOSITORY_NAME }}:${{ env.RELEASE_TAG }} username: ${{ env.DOCKER_HUB_USERNAME }} password: ${{ env.DOCKER_HUB_PASSWORD }} \ No newline at end of file From 59b17bb68bf765b0497277d458fd655f25267523 Mon Sep 17 00:00:00 2001 From: NishaSharma14 Date: Thu, 4 Jan 2024 12:37:39 +0100 Subject: [PATCH 02/12] skip testing --- .github/workflows/dev-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev-build.yml b/.github/workflows/dev-build.yml index abd0bff..53baa0a 100644 --- a/.github/workflows/dev-build.yml +++ b/.github/workflows/dev-build.yml @@ -28,7 +28,7 @@ jobs: push_to_registry: name: Push Docker image to Docker Hub runs-on: ubuntu-latest - needs: test_and_lint + #needs: test_and_lint steps: - name: Check out the repo uses: actions/checkout@v3 From 6ed829125945e7ace314259fe78b23dc7cee38d3 Mon Sep 17 00:00:00 2001 From: NishaSharma14 Date: Thu, 4 Jan 2024 12:39:49 +0100 Subject: [PATCH 03/12] update context path --- .github/workflows/dev-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev-build.yml b/.github/workflows/dev-build.yml index 53baa0a..05c2a28 100644 --- a/.github/workflows/dev-build.yml +++ b/.github/workflows/dev-build.yml @@ -54,8 +54,8 @@ jobs: - name: Build and push nmr-cli Docker image uses: docker/build-push-action@v4 with: - context: ./app/scripts/nmr-cli - file: ./Dockerfile + context: . + file: ./app/scripts/nmr-cli/Dockerfile push: true build-args: | RELEASE_VERSION=dev-latest From a28853ef4f0bae2973ee7758419a8bef5f7559be Mon Sep 17 00:00:00 2001 From: NishaSharma14 Date: Thu, 4 Jan 2024 13:16:08 +0100 Subject: [PATCH 04/12] update context path --- .github/workflows/dev-build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dev-build.yml b/.github/workflows/dev-build.yml index 05c2a28..ea20891 100644 --- a/.github/workflows/dev-build.yml +++ b/.github/workflows/dev-build.yml @@ -22,8 +22,8 @@ env: RELEASE_TAG: dev-latest jobs: - test_and_lint: - uses: NFDI4Chem/nmrkit/.github/workflows/test.yml@main + # test_and_lint: + # uses: NFDI4Chem/nmrkit/.github/workflows/test.yml@main push_to_registry: name: Push Docker image to Docker Hub @@ -54,7 +54,7 @@ jobs: - name: Build and push nmr-cli Docker image uses: docker/build-push-action@v4 with: - context: . + context: ./app/scripts/nmr-cli/ file: ./app/scripts/nmr-cli/Dockerfile push: true build-args: | From f9499dcac612b8929ecc425859f1eb31a22156de Mon Sep 17 00:00:00 2001 From: NishaSharma14 Date: Thu, 4 Jan 2024 13:21:45 +0100 Subject: [PATCH 05/12] update repo name --- .github/workflows/dev-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev-build.yml b/.github/workflows/dev-build.yml index ea20891..ffd261a 100644 --- a/.github/workflows/dev-build.yml +++ b/.github/workflows/dev-build.yml @@ -17,7 +17,7 @@ env: DOCKER_HUB_USERNAME : ${{ secrets.DOCKER_USERNAME }} DOCKER_HUB_PASSWORD : ${{ secrets.DOCKER_PASSWORD }} NMRKIT_REPOSITORY_NAME: nmrkit - NMR_CLI_REPOSITORY_NAME: nmrkit + NMR_CLI_REPOSITORY_NAME: nmr-cli REPOSITORY_NAMESPACE: nfdi4chem RELEASE_TAG: dev-latest From ef56a4a48f30d88382d751895db5a7c96b0bb691 Mon Sep 17 00:00:00 2001 From: NishaSharma14 Date: Thu, 4 Jan 2024 13:27:56 +0100 Subject: [PATCH 06/12] uncomment old changes --- .github/workflows/dev-build.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/dev-build.yml b/.github/workflows/dev-build.yml index ffd261a..1c513f7 100644 --- a/.github/workflows/dev-build.yml +++ b/.github/workflows/dev-build.yml @@ -22,8 +22,8 @@ env: RELEASE_TAG: dev-latest jobs: - # test_and_lint: - # uses: NFDI4Chem/nmrkit/.github/workflows/test.yml@main + test_and_lint: + uses: NFDI4Chem/nmrkit/.github/workflows/test.yml@main push_to_registry: name: Push Docker image to Docker Hub @@ -39,17 +39,17 @@ jobs: username: ${{ env.DOCKER_HUB_USERNAME }} password: ${{ env.DOCKER_HUB_PASSWORD }} - # - name: Build and push nmrKit Docker image - # uses: docker/build-push-action@v4 - # with: - # context: . - # file: ./Dockerfile - # push: true - # build-args: | - # RELEASE_VERSION=dev-latest - # tags: ${{ env.REPOSITORY_NAMESPACE }}/${{ env.NMRKIT_REPOSITORY_NAME }}:${{ env.RELEASE_TAG }} - # username: ${{ env.DOCKER_HUB_USERNAME }} - # password: ${{ env.DOCKER_HUB_PASSWORD }} + - name: Build and push nmrKit Docker image + uses: docker/build-push-action@v4 + with: + context: . + file: ./Dockerfile + push: true + build-args: | + RELEASE_VERSION=dev-latest + tags: ${{ env.REPOSITORY_NAMESPACE }}/${{ env.NMRKIT_REPOSITORY_NAME }}:${{ env.RELEASE_TAG }} + username: ${{ env.DOCKER_HUB_USERNAME }} + password: ${{ env.DOCKER_HUB_PASSWORD }} - name: Build and push nmr-cli Docker image uses: docker/build-push-action@v4 From 4d3540fbdb331eb4fead011ce1519b1427140809 Mon Sep 17 00:00:00 2001 From: NishaSharma14 Date: Thu, 4 Jan 2024 13:28:23 +0100 Subject: [PATCH 07/12] update branch name --- .github/workflows/dev-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev-build.yml b/.github/workflows/dev-build.yml index 1c513f7..b7dc12a 100644 --- a/.github/workflows/dev-build.yml +++ b/.github/workflows/dev-build.yml @@ -11,7 +11,7 @@ name : Dev Build, Test and Publish on: push: - branches: [dev-nisha] + branches: [development] env: DOCKER_HUB_USERNAME : ${{ secrets.DOCKER_USERNAME }} From 27d568a46e713cd68d25304f80ac12413c6e6c63 Mon Sep 17 00:00:00 2001 From: NishaSharma14 Date: Thu, 4 Jan 2024 12:36:36 +0100 Subject: [PATCH 08/12] feat: add automated build for nmr-cli --- .github/workflows/dev-build.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dev-build.yml b/.github/workflows/dev-build.yml index 0bea825..b7dc12a 100644 --- a/.github/workflows/dev-build.yml +++ b/.github/workflows/dev-build.yml @@ -16,7 +16,8 @@ on: env: DOCKER_HUB_USERNAME : ${{ secrets.DOCKER_USERNAME }} DOCKER_HUB_PASSWORD : ${{ secrets.DOCKER_PASSWORD }} - REPOSITORY_NAME: nmrkit + NMRKIT_REPOSITORY_NAME: nmrkit + NMR_CLI_REPOSITORY_NAME: nmr-cli REPOSITORY_NAMESPACE: nfdi4chem RELEASE_TAG: dev-latest @@ -27,7 +28,7 @@ jobs: push_to_registry: name: Push Docker image to Docker Hub runs-on: ubuntu-latest - needs: test_and_lint + #needs: test_and_lint steps: - name: Check out the repo uses: actions/checkout@v3 @@ -38,7 +39,7 @@ jobs: username: ${{ env.DOCKER_HUB_USERNAME }} password: ${{ env.DOCKER_HUB_PASSWORD }} - - name: Build and push Docker image + - name: Build and push nmrKit Docker image uses: docker/build-push-action@v4 with: context: . @@ -46,6 +47,18 @@ jobs: push: true build-args: | RELEASE_VERSION=dev-latest - tags: ${{ env.REPOSITORY_NAMESPACE }}/${{ env.REPOSITORY_NAME }}:${{ env.RELEASE_TAG }} + tags: ${{ env.REPOSITORY_NAMESPACE }}/${{ env.NMRKIT_REPOSITORY_NAME }}:${{ env.RELEASE_TAG }} + username: ${{ env.DOCKER_HUB_USERNAME }} + password: ${{ env.DOCKER_HUB_PASSWORD }} + + - name: Build and push nmr-cli Docker image + uses: docker/build-push-action@v4 + with: + context: ./app/scripts/nmr-cli/ + file: ./app/scripts/nmr-cli/Dockerfile + push: true + build-args: | + RELEASE_VERSION=dev-latest + tags: ${{ env.REPOSITORY_NAMESPACE }}/${{ env.NMR_CLI_REPOSITORY_NAME }}:${{ env.RELEASE_TAG }} username: ${{ env.DOCKER_HUB_USERNAME }} password: ${{ env.DOCKER_HUB_PASSWORD }} \ No newline at end of file From 4707d9806036957845e6fe5b6f9441904c5ea58f Mon Sep 17 00:00:00 2001 From: NishaSharma14 Date: Thu, 4 Jan 2024 13:39:16 +0100 Subject: [PATCH 09/12] fix: ignore lwreg in pylint --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c67c001..c9a1698 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -59,7 +59,7 @@ jobs: pip install flake8 pytest - name: Analysing the code with pylint run: | - flake8 --per-file-ignores="__init__.py:F401" --ignore E402,E501,W503 $(git ls-files 'app/*.py') . + flake8 --per-file-ignores="__init__.py:F401" --ignore E402,E501,W503 $(git ls-files 'app/*.py') --ignore=lwreg/lwreg/ . - name: Run test run: | python3 -m pytest -p no:warnings --ignore=lwreg/lwreg/test-cli.py --ignore=lwreg/lwreg/test_lwreg.py From 483ac8f0b390691ec778e048ecfb5250305c5a2d Mon Sep 17 00:00:00 2001 From: NishaSharma14 Date: Thu, 4 Jan 2024 13:45:54 +0100 Subject: [PATCH 10/12] ignore lwreg in pylint --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c9a1698..7b29312 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -59,7 +59,7 @@ jobs: pip install flake8 pytest - name: Analysing the code with pylint run: | - flake8 --per-file-ignores="__init__.py:F401" --ignore E402,E501,W503 $(git ls-files 'app/*.py') --ignore=lwreg/lwreg/ . + flake8 --per-file-ignores="__init__.py:F401" --ignore E402,E501,W503,lwreg/lwreg/ $(git ls-files 'app/*.py') . - name: Run test run: | python3 -m pytest -p no:warnings --ignore=lwreg/lwreg/test-cli.py --ignore=lwreg/lwreg/test_lwreg.py From 3b53f347638154861a6cd05a58c572698f5ea5c4 Mon Sep 17 00:00:00 2001 From: NishaSharma14 Date: Thu, 4 Jan 2024 13:53:38 +0100 Subject: [PATCH 11/12] remove the ignore command --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7b29312..c67c001 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -59,7 +59,7 @@ jobs: pip install flake8 pytest - name: Analysing the code with pylint run: | - flake8 --per-file-ignores="__init__.py:F401" --ignore E402,E501,W503,lwreg/lwreg/ $(git ls-files 'app/*.py') . + flake8 --per-file-ignores="__init__.py:F401" --ignore E402,E501,W503 $(git ls-files 'app/*.py') . - name: Run test run: | python3 -m pytest -p no:warnings --ignore=lwreg/lwreg/test-cli.py --ignore=lwreg/lwreg/test_lwreg.py From f7f8e427e01ae27d177b3a261565007bee366c37 Mon Sep 17 00:00:00 2001 From: NishaSharma14 Date: Fri, 12 Jan 2024 15:52:58 +0100 Subject: [PATCH 12/12] fix: pull image from Docker Hub instead of building locally. --- docker-compose.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 40ddb3d..30451e3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -28,13 +28,15 @@ services: env_file: - ./.env nmr-load-save: - build: ./app/scripts/nmr-cli + #build: ./app/scripts/nmr-cli + image: nfdi4chem/nmr-cli:dev-latest entrypoint: /bin/sh stdin_open: true tty: true container_name: nmr-converter nmr-respredict: - build: ./app/scripts/nmr-respredict + #build: ./app/scripts/nmr-respredict + image: nfdi4chem/nmr-respredict:dev-latest entrypoint: /bin/sh stdin_open: true tty: true