From 9251957b622b6e1fdd0a5f4ba25761ee7147f56d Mon Sep 17 00:00:00 2001 From: Gage Larsen Date: Thu, 23 May 2024 10:00:14 -0600 Subject: [PATCH] address feedback from code review. --- .github/workflows/tethys-release.yml | 8 +------- .github/workflows/tethys.yml | 16 +++++++--------- scripts/install_tethys.sh | 2 ++ 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/.github/workflows/tethys-release.yml b/.github/workflows/tethys-release.yml index 3de9ffcd5..d4c6ed75c 100644 --- a/.github/workflows/tethys-release.yml +++ b/.github/workflows/tethys-release.yml @@ -69,12 +69,6 @@ jobs: run: | echo "Pushing to docker registry"; docker push ${{ secrets.DOCKER_UPLOAD_URL }}:${{ steps.safetag.outputs.safetag }}; - - name: Upload Docker With Latest Tag - if: ${{ steps.version.outputs.prerelease == '' }} - run: | - echo "Updating latest on the docker registry"; - docker tag ${{ secrets.DOCKER_UPLOAD_URL }}:${{ steps.safetag.outputs.safetag }} ${{ secrets.DOCKER_UPLOAD_URL }}:latest; - docker push ${{ secrets.DOCKER_UPLOAD_URL }}:latest; conda-build: name: Conda Build (${{ matrix.platform }}) @@ -119,7 +113,7 @@ jobs: - name: Setup Tethys run: | cd .. - bash ./tethys/scripts/install_tethys.sh --partial-tethys-install me -n tethys -s $PWD/tethys + bash ./tethys/scripts/install_tethys.sh --partial-tethys-install me -n tethys -s $PWD/tethys -p "3.8" . ~/miniconda/etc/profile.d/conda.sh conda activate tethys hash -r diff --git a/.github/workflows/tethys.yml b/.github/workflows/tethys.yml index c08fcb924..70d7ddfa9 100644 --- a/.github/workflows/tethys.yml +++ b/.github/workflows/tethys.yml @@ -16,7 +16,7 @@ on: env: CONDA_BUILD_PIN_LEVEL: minor GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - TEST_IMAGE: tethys:dev + TEST_IMAGE: tethys POSTGRES_DB: tethys_postgis POSTGRES_PASSWORD: please_dont_use_default_passwords POSTGRES_PORT: 5432 @@ -109,15 +109,15 @@ jobs: # Build the docker for no tag - name: Build Without Tag run: | - docker build --build-arg DJANGO_VERSION=${{ matrix.django-version }} --build-arg PYTHON_VERSION=${{ matrix.python-version }} -t ${{ secrets.DOCKER_UPLOAD_URL }}:dev .; - docker tag ${{ secrets.DOCKER_UPLOAD_URL }}:dev ${{ env.TEST_IMAGE }}-${{ matrix.django-version }}-${{ matrix.python-version }}; + docker build --build-arg DJANGO_VERSION=${{ matrix.django-version }} --build-arg PYTHON_VERSION=${{ matrix.python-version }} -t ${{ secrets.DOCKER_UPLOAD_URL }}:${{ matrix.python-version }}-${{ matrix.django-version }}-dev .; + docker tag ${{ secrets.DOCKER_UPLOAD_URL }}:${{ matrix.python-version }}-${{ matrix.django-version }}-dev ${{ env.TEST_IMAGE }}:${{ matrix.python-version }}-${{ matrix.django-version }}-dev; # Upload docker if pull request no tag - name: Upload Docker No Tag if: ${{ github.event_name != 'pull_request' }} run: | echo "Pushing to docker registry"; echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin; - docker push ${{ secrets.DOCKER_UPLOAD_URL }}:${{ env.TEST_IMAGE }}-${{ matrix.django-version }}-${{ matrix.python-version }}; + docker push ${{ secrets.DOCKER_UPLOAD_URL }}:${{ matrix.python-version }}-${{ matrix.django-version }}-dev; # No Upload if Pull Request - name: No Upload if: ${{ github.event_name == 'pull_request' }} @@ -127,7 +127,7 @@ jobs: - name: Upload Docker Artifact uses: ishworkh/docker-image-artifact-upload@v1 with: - image: ${{ env.TEST_IMAGE }}-${{ matrix.django-version }}-${{ matrix.python-version }} + image: ${{ env.TEST_IMAGE }}:${{ matrix.python-version }}-${{ matrix.django-version }}-dev retention_days: "1" startup_test: @@ -176,14 +176,12 @@ jobs: /bin/bash -c "cd /usr/lib/tethys && source ./run.sh --test" conda-build: - name: Conda Build (${{ matrix.platform }}, ${{ matrix.django-version }}, ${{ matrix.python-version }}) + name: Conda Build runs-on: ${{ matrix.platform }} strategy: fail-fast: false matrix: platform: [ubuntu-latest] - python-version: ["3.10", "3.11", "3.12"] - django-version: ["3.2", "4.2", "5.0"] steps: # Checkout the source - name: Checkout Source @@ -194,7 +192,7 @@ jobs: - name: Setup Tethys run: | cd .. - bash ./tethys/scripts/install_tethys.sh --partial-tethys-install me -n tethys -s $PWD/tethys -d ${{ matrix.django-version }} -p ${{ matrix.python-version }} + bash ./tethys/scripts/install_tethys.sh --partial-tethys-install me -n tethys -s $PWD/tethys . ~/miniconda/etc/profile.d/conda.sh conda activate tethys hash -r diff --git a/scripts/install_tethys.sh b/scripts/install_tethys.sh index e264dd052..66165fece 100644 --- a/scripts/install_tethys.sh +++ b/scripts/install_tethys.sh @@ -367,12 +367,14 @@ then then echo "Updating environment.yml Django version ${DJANGO_VERSION}..." sudo sed -i.bak "s/django>=.*/django>=${DJANGO_VERSION}/" "${TETHYS_SRC}/environment.yml" + sudo sed -i.bak "s/django>=.*/django>=${DJANGO_VERSION}/" "${TETHYS_SRC}/micro_environment.yml" fi if [ -n "${PYTHON_VERSION}" ] then echo "Updating environment.yml Python version ${PYTHON_VERSION}..." sudo sed -i.bak "s/django>=.*/python>=${PYTHON_VERSION}/" "${TETHYS_SRC}/environment.yml" + sudo sed -i.bak "s/django>=.*/python>=${PYTHON_VERSION}/" "${TETHYS_SRC}/micro_environment.yml" fi if [ -n "${CREATE_ENV}" ]