From 524357036b9e6cded1076e6b080f358c0cdaa9b0 Mon Sep 17 00:00:00 2001 From: Joshua Gilman Date: Wed, 23 Oct 2024 08:47:09 -0700 Subject: [PATCH 01/14] fix: uses correct id in argocd container --- .github/workflows/release.yml | 10 ++++++++++ tools/argocd/Earthfile | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 68f50458..d882183d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -75,5 +75,15 @@ jobs: args: ${{ matrix.release.project }} ${{ matrix.release.name }} local: ${{ inputs.local }} verbosity: ${{ inputs.verbosity }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Release Temp + uses: input-output-hk/catalyst-forge/actions/run@master + if: matrix.release.project == './tools/argocd' + with: + command: release + args: --force ${{ matrix.release.project }} ${{ matrix.release.name }} + local: ${{ inputs.local }} + verbosity: ${{ inputs.verbosity }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/tools/argocd/Earthfile b/tools/argocd/Earthfile index c5e438bd..fc4fab56 100644 --- a/tools/argocd/Earthfile +++ b/tools/argocd/Earthfile @@ -20,7 +20,7 @@ docker: ARG TARGETARCH ARG USERPLATFORM - RUN useradd -m argocd + RUN useradd -m -u 999 argocd USER argocd WORKDIR /home/argocd From 85a855d32a843d6d85300dec360b6301ae66cf7d Mon Sep 17 00:00:00 2001 From: Joshua Gilman Date: Wed, 23 Oct 2024 09:06:57 -0700 Subject: [PATCH 02/14] wip: fix --- .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 524f5180..c83eb629 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -150,7 +150,7 @@ jobs: earthly_token: ${{ secrets.earthly_token }} deploy: - uses: input-output-hk/catalyst-forge/.github/workflows/deploy.yml@master + uses: input-output-hk/catalyst-forge/.github/workflows/deploy.yml@fix-argo-container needs: [discover, check, build, test, release] if: (fromJson(needs.discover.outputs.deployments)[0] != null) && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && !failure() && !cancelled() with: From d018c20edc67b3375712d2e5c5d7eb3b694beeb9 Mon Sep 17 00:00:00 2001 From: Joshua Gilman Date: Wed, 23 Oct 2024 09:24:04 -0700 Subject: [PATCH 03/14] wip: fix --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c83eb629..42510c30 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -138,7 +138,7 @@ jobs: earthly_token: ${{ secrets.earthly_token }} release: - uses: input-output-hk/catalyst-forge/.github/workflows/release.yml@master + uses: input-output-hk/catalyst-forge/.github/workflows/release.yml@fix-argo-container needs: [discover, check, build, test] if: (fromJson(needs.discover.outputs.releases)[0] != null) && !failure() && !cancelled() with: @@ -150,7 +150,7 @@ jobs: earthly_token: ${{ secrets.earthly_token }} deploy: - uses: input-output-hk/catalyst-forge/.github/workflows/deploy.yml@fix-argo-container + uses: input-output-hk/catalyst-forge/.github/workflows/deploy.yml@master needs: [discover, check, build, test, release] if: (fromJson(needs.discover.outputs.deployments)[0] != null) && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && !failure() && !cancelled() with: From 9aac7a90fb30c662e4a773e903e564eed1076533 Mon Sep 17 00:00:00 2001 From: Joshua Gilman Date: Wed, 23 Oct 2024 09:58:15 -0700 Subject: [PATCH 04/14] fix: adds ca certs --- tools/argocd/Earthfile | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/argocd/Earthfile b/tools/argocd/Earthfile index fc4fab56..52d045e7 100644 --- a/tools/argocd/Earthfile +++ b/tools/argocd/Earthfile @@ -20,6 +20,7 @@ docker: ARG TARGETARCH ARG USERPLATFORM + RUN apt-get update && apt-get install -y ca-certificates RUN useradd -m -u 999 argocd USER argocd From b96428cc57920959ad9bb159f6c655573b364272 Mon Sep 17 00:00:00 2001 From: benbooth493 Date: Thu, 24 Oct 2024 11:36:06 +0100 Subject: [PATCH 05/14] Add init.sh script --- tools/argocd/Earthfile | 4 ++-- tools/argocd/helpers/init.sh | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 tools/argocd/helpers/init.sh diff --git a/tools/argocd/Earthfile b/tools/argocd/Earthfile index 52d045e7..e7196edd 100644 --- a/tools/argocd/Earthfile +++ b/tools/argocd/Earthfile @@ -37,7 +37,7 @@ docker: RUN mkdir -p cmp-server/config COPY plugin.yml cmp-server/config/plugin.yaml + COPY init.sh /home/argocd/init.sh + ENTRYPOINT [ "/var/run/argocd/argocd-cmp-server" ] SAVE IMAGE ${container}:${tag} - - diff --git a/tools/argocd/helpers/init.sh b/tools/argocd/helpers/init.sh new file mode 100644 index 00000000..3d287792 --- /dev/null +++ b/tools/argocd/helpers/init.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -o errexit +set -o nounset +set -o pipefail +set -o xtrace + +ACCOUNT_ID=$(echo "${AWS_ROLE_ARN}" | cut -d':' -f5) +mkdir -p /home/argocd/.docker +cat >/home/argocd/.docker/config.json < Date: Thu, 24 Oct 2024 11:41:28 +0100 Subject: [PATCH 06/14] Move to root --- tools/argocd/{helpers => }/init.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tools/argocd/{helpers => }/init.sh (100%) diff --git a/tools/argocd/helpers/init.sh b/tools/argocd/init.sh similarity index 100% rename from tools/argocd/helpers/init.sh rename to tools/argocd/init.sh From 2d6be7eb613b0629d2381029fac8c40685102e24 Mon Sep 17 00:00:00 2001 From: benbooth493 Date: Thu, 24 Oct 2024 11:52:05 +0100 Subject: [PATCH 07/14] Set execute bit --- tools/argocd/Earthfile | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/argocd/Earthfile b/tools/argocd/Earthfile index e7196edd..276180d9 100644 --- a/tools/argocd/Earthfile +++ b/tools/argocd/Earthfile @@ -38,6 +38,7 @@ docker: COPY plugin.yml cmp-server/config/plugin.yaml COPY init.sh /home/argocd/init.sh + RUN chmod +x /home/argocd/init.sh ENTRYPOINT [ "/var/run/argocd/argocd-cmp-server" ] SAVE IMAGE ${container}:${tag} From 80a0230e0a2cf8a0b87f03090ea3fa7829c15fe6 Mon Sep 17 00:00:00 2001 From: Joshua Gilman Date: Thu, 24 Oct 2024 08:12:35 -0700 Subject: [PATCH 08/14] fix: try version 0.17.0 --- tools/argocd/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/argocd/Earthfile b/tools/argocd/Earthfile index 276180d9..700d1912 100644 --- a/tools/argocd/Earthfile +++ b/tools/argocd/Earthfile @@ -3,7 +3,7 @@ VERSION 0.8 timoni: FROM golang:1.23.0 - ARG TIMONI_VERSION=v0.22.1 + ARG TIMONI_VERSION=v0.17.0 WORKDIR /work From cb1295e1c52f04c977e52c33673951f4d9717d78 Mon Sep 17 00:00:00 2001 From: Joshua Gilman Date: Thu, 24 Oct 2024 08:26:54 -0700 Subject: [PATCH 09/14] wip: adds ECR helper --- tools/argocd/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/argocd/Earthfile b/tools/argocd/Earthfile index 700d1912..b31dd56b 100644 --- a/tools/argocd/Earthfile +++ b/tools/argocd/Earthfile @@ -20,7 +20,7 @@ docker: ARG TARGETARCH ARG USERPLATFORM - RUN apt-get update && apt-get install -y ca-certificates + RUN apt-get update && apt-get install -y ca-certificates amazon-ecr-credential-helper RUN useradd -m -u 999 argocd USER argocd From 622f5b197dd5c1d51f5dcac7d8d8bd206d67706f Mon Sep 17 00:00:00 2001 From: benbooth493 Date: Tue, 29 Oct 2024 09:03:35 +0000 Subject: [PATCH 10/14] Bump version --- foundry/api/blueprint.cue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/foundry/api/blueprint.cue b/foundry/api/blueprint.cue index 00d8c23c..00c6a9cd 100644 --- a/foundry/api/blueprint.cue +++ b/foundry/api/blueprint.cue @@ -17,7 +17,7 @@ project: { environment: "dev" modules: main: { container: "foundry-api-deployment" - version: "0.1.0" + version: "0.1.1" values: { environment: name: "dev" server: image: { From e5285611710d00258d7479e974d2c63f19a22836 Mon Sep 17 00:00:00 2001 From: Joshua Gilman Date: Tue, 29 Oct 2024 17:28:01 -0700 Subject: [PATCH 11/14] wip: testing --- .github/workflows/release.yml | 2 +- foundry/api/blueprint.cue | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d882183d..a0336a91 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -79,7 +79,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Release Temp uses: input-output-hk/catalyst-forge/actions/run@master - if: matrix.release.project == './tools/argocd' + if: matrix.release.project == './foundry/api' with: command: release args: --force ${{ matrix.release.project }} ${{ matrix.release.name }} diff --git a/foundry/api/blueprint.cue b/foundry/api/blueprint.cue index 00c6a9cd..d371b006 100644 --- a/foundry/api/blueprint.cue +++ b/foundry/api/blueprint.cue @@ -16,6 +16,7 @@ project: { deployment: { environment: "dev" modules: main: { + namespace: string | *"default" @env(name="NAMESPACE",type="string") container: "foundry-api-deployment" version: "0.1.1" values: { From 7eeec00c3f0c81cefc516362d65b611dd9429714 Mon Sep 17 00:00:00 2001 From: Joshua Gilman Date: Tue, 29 Oct 2024 17:48:49 -0700 Subject: [PATCH 12/14] wip: testing --- .github/workflows/ci.yml | 144 ++++++++++++++++++++------------------- 1 file changed, 73 insertions(+), 71 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 42510c30..c8cd7fe6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,12 +41,12 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install Forge - uses: input-output-hk/catalyst-forge/actions/install@master + uses: input-output-hk/catalyst-forge/actions/install@mve-next if: ${{ inputs.forge_version != 'local' }} with: version: ${{ inputs.forge_version }} - name: Install Local Forge - uses: input-output-hk/catalyst-forge/actions/install-local@master + uses: input-output-hk/catalyst-forge/actions/install-local@mve-next if: ${{ inputs.forge_version == 'local' }} with: earthly_token: ${{ secrets.earthly_token }} @@ -61,14 +61,14 @@ jobs: echo "skip=false" >> $GITHUB_OUTPUT fi - name: Setup CI - uses: input-output-hk/catalyst-forge/actions/setup@master + uses: input-output-hk/catalyst-forge/actions/setup@mve-next with: skip_docker: 'true' skip_github: 'true' skip_earthly: ${{ steps.local.outputs.skip }} - name: Discovery id: discovery - uses: input-output-hk/catalyst-forge/actions/discovery@master + uses: input-output-hk/catalyst-forge/actions/discovery@mve-next with: filters: | ${{ env.FORGE_REGEX_CHECK }} @@ -79,67 +79,68 @@ jobs: ${{ env.FORGE_REGEX_RELEASE }} ${{ env.FORGE_REGEX_PUBLISH }} - check: - uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@master - needs: [discover] - if: (fromJson(needs.discover.outputs.earthfiles)['^check(-.*)?$'] != null) && !failure() && !cancelled() - with: - earthfiles: ${{ toJson(fromJson(needs.discover.outputs.earthfiles)['^check(-.*)?$']) }} - forge_version: ${{ inputs.forge_version }} - local: ${{ inputs.local }} - verbosity: ${{ inputs.verbosity }} - secrets: - earthly_token: ${{ secrets.earthly_token }} + # check: + # uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@mve-next + # needs: [discover] + # if: (fromJson(needs.discover.outputs.earthfiles)['^check(-.*)?$'] != null) && !failure() && !cancelled() + # with: + # earthfiles: ${{ toJson(fromJson(needs.discover.outputs.earthfiles)['^check(-.*)?$']) }} + # forge_version: ${{ inputs.forge_version }} + # local: ${{ inputs.local }} + # verbosity: ${{ inputs.verbosity }} + # secrets: + # earthly_token: ${{ secrets.earthly_token }} - build: - uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@master - needs: [discover, check] - if: (fromJson(needs.discover.outputs.earthfiles)['^build(-.*)?$'] != null) && !failure() && !cancelled() - with: - earthfiles: ${{ toJson(fromJson(needs.discover.outputs.earthfiles)['^build(-.*)?$']) }} - forge_version: ${{ inputs.forge_version }} - local: ${{ inputs.local }} - verbosity: ${{ inputs.verbosity }} - secrets: - earthly_token: ${{ secrets.earthly_token }} + # build: + # uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@mve-next + # needs: [discover, check] + # if: (fromJson(needs.discover.outputs.earthfiles)['^build(-.*)?$'] != null) && !failure() && !cancelled() + # with: + # earthfiles: ${{ toJson(fromJson(needs.discover.outputs.earthfiles)['^build(-.*)?$']) }} + # forge_version: ${{ inputs.forge_version }} + # local: ${{ inputs.local }} + # verbosity: ${{ inputs.verbosity }} + # secrets: + # earthly_token: ${{ secrets.earthly_token }} - package: - uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@master - needs: [discover, check, build] - if: (fromJson(needs.discover.outputs.earthfiles)['^package(-.*)?$'] != null) && !failure() && !cancelled() - with: - earthfiles: ${{ toJson(fromJson(needs.discover.outputs.earthfiles)['^package(-.*)?$']) }} - forge_version: ${{ inputs.forge_version }} - local: ${{ inputs.local }} - verbosity: ${{ inputs.verbosity }} - secrets: - earthly_token: ${{ secrets.earthly_token }} + # package: + # uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@mve-next + # needs: [discover, check, build] + # if: (fromJson(needs.discover.outputs.earthfiles)['^package(-.*)?$'] != null) && !failure() && !cancelled() + # with: + # earthfiles: ${{ toJson(fromJson(needs.discover.outputs.earthfiles)['^package(-.*)?$']) }} + # forge_version: ${{ inputs.forge_version }} + # local: ${{ inputs.local }} + # verbosity: ${{ inputs.verbosity }} + # secrets: + # earthly_token: ${{ secrets.earthly_token }} - test: - uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@master - needs: [discover, check, build, package] - if: (fromJson(needs.discover.outputs.earthfiles)['^test(-.*)?$'] != null) && !failure() && !cancelled() - with: - earthfiles: ${{ toJson(fromJson(needs.discover.outputs.earthfiles)['^test(-.*)?$']) }} - forge_version: ${{ inputs.forge_version }} - local: ${{ inputs.local }} - verbosity: ${{ inputs.verbosity }} - secrets: - earthly_token: ${{ secrets.earthly_token }} + # test: + # uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@mve-next + # needs: [discover, check, build, package] + # if: (fromJson(needs.discover.outputs.earthfiles)['^test(-.*)?$'] != null) && !failure() && !cancelled() + # with: + # earthfiles: ${{ toJson(fromJson(needs.discover.outputs.earthfiles)['^test(-.*)?$']) }} + # forge_version: ${{ inputs.forge_version }} + # local: ${{ inputs.local }} + # verbosity: ${{ inputs.verbosity }} + # secrets: + # earthly_token: ${{ secrets.earthly_token }} - docs: - uses: input-output-hk/catalyst-forge/.github/workflows/docs.yml@master - needs: [discover, check, build, test] - if: (fromJson(needs.discover.outputs.earthfiles)['^docs(-.*)?$'] != null) && !failure() && !cancelled() - with: - earthfiles: ${{ toJson(fromJson(needs.discover.outputs.earthfiles)['^docs(-.*)?$']) }} - forge_version: ${{ inputs.forge_version }} - secrets: - earthly_token: ${{ secrets.earthly_token }} + # docs: + # uses: input-output-hk/catalyst-forge/.github/workflows/docs.yml@mve-next + # needs: [discover, check, build, test] + # if: (fromJson(needs.discover.outputs.earthfiles)['^docs(-.*)?$'] != null) && !failure() && !cancelled() + # with: + # earthfiles: ${{ toJson(fromJson(needs.discover.outputs.earthfiles)['^docs(-.*)?$']) }} + # forge_version: ${{ inputs.forge_version }} + # secrets: + # earthly_token: ${{ secrets.earthly_token }} release: - uses: input-output-hk/catalyst-forge/.github/workflows/release.yml@fix-argo-container - needs: [discover, check, build, test] + uses: input-output-hk/catalyst-forge/.github/workflows/release.yml@mve-next + #needs: [discover, check, build, test] + needs: [discover] if: (fromJson(needs.discover.outputs.releases)[0] != null) && !failure() && !cancelled() with: releases: ${{ needs.discover.outputs.releases }} @@ -149,20 +150,21 @@ jobs: secrets: earthly_token: ${{ secrets.earthly_token }} - deploy: - uses: input-output-hk/catalyst-forge/.github/workflows/deploy.yml@master - needs: [discover, check, build, test, release] - if: (fromJson(needs.discover.outputs.deployments)[0] != null) && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && !failure() && !cancelled() - with: - deployments: ${{ needs.discover.outputs.deployments }} - forge_version: ${{ inputs.forge_version }} - local: ${{ inputs.local }} - verbosity: ${{ inputs.verbosity }} - secrets: - earthly_token: ${{ secrets.earthly_token }} + # deploy: + # uses: input-output-hk/catalyst-forge/.github/workflows/deploy.yml@mve-next + # needs: [discover, check, build, test, release] + # if: (fromJson(needs.discover.outputs.deployments)[0] != null) && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && !failure() && !cancelled() + # with: + # deployments: ${{ needs.discover.outputs.deployments }} + # forge_version: ${{ inputs.forge_version }} + # local: ${{ inputs.local }} + # verbosity: ${{ inputs.verbosity }} + # secrets: + # earthly_token: ${{ secrets.earthly_token }} final: - needs: [check, build, package, test, release] + #needs: [check, build, package, test, release] + needs: [discover] if: (!failure() && !cancelled()) runs-on: ubuntu-latest steps: From 0aeab2b2437727df94edb6bc1dc765d6df2221ad Mon Sep 17 00:00:00 2001 From: Joshua Gilman Date: Wed, 30 Oct 2024 18:34:55 -0700 Subject: [PATCH 13/14] wip: use always --- .github/workflows/release.yml | 10 ---------- foundry/api/blueprint.cue | 5 +++-- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a0336a91..68f50458 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -75,15 +75,5 @@ jobs: args: ${{ matrix.release.project }} ${{ matrix.release.name }} local: ${{ inputs.local }} verbosity: ${{ inputs.verbosity }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Release Temp - uses: input-output-hk/catalyst-forge/actions/run@master - if: matrix.release.project == './foundry/api' - with: - command: release - args: --force ${{ matrix.release.project }} ${{ matrix.release.name }} - local: ${{ inputs.local }} - verbosity: ${{ inputs.verbosity }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/foundry/api/blueprint.cue b/foundry/api/blueprint.cue index d371b006..5da6f0ad 100644 --- a/foundry/api/blueprint.cue +++ b/foundry/api/blueprint.cue @@ -30,8 +30,9 @@ project: { release: { docker: { on: { - merge: {} - tag: {} + //merge: {} + //tag: {} + always: {} } config: { tag: _ @forge(name="GIT_COMMIT_HASH") From e6c5749f84a844966c3900a10bf9fafd6881a133 Mon Sep 17 00:00:00 2001 From: Joshua Gilman Date: Thu, 31 Oct 2024 11:04:02 -0700 Subject: [PATCH 14/14] wip: update namespace --- foundry/api/blueprint.cue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/foundry/api/blueprint.cue b/foundry/api/blueprint.cue index 5da6f0ad..b8d7872c 100644 --- a/foundry/api/blueprint.cue +++ b/foundry/api/blueprint.cue @@ -16,7 +16,7 @@ project: { deployment: { environment: "dev" modules: main: { - namespace: string | *"default" @env(name="NAMESPACE",type="string") + namespace: string | *"default" @env(name="ARGOCD_APP_NAMESPACE",type="string") container: "foundry-api-deployment" version: "0.1.1" values: {