From ca576d041639574fcc3000ea434d0b07b56ae889 Mon Sep 17 00:00:00 2001 From: konsumgandalf Date: Thu, 11 Jan 2024 01:08:26 +0100 Subject: [PATCH 01/17] feat: add docker build action --- .github/workflows/profaastinate.yaml | 53 ++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 6 deletions(-) diff --git a/.github/workflows/profaastinate.yaml b/.github/workflows/profaastinate.yaml index 490c645cc4..543e8d07cb 100644 --- a/.github/workflows/profaastinate.yaml +++ b/.github/workflows/profaastinate.yaml @@ -6,6 +6,9 @@ on: workflow_dispatch: +env: + REGISTRY: ghcr.io + jobs: install-deps: runs-on: ubuntu-latest @@ -15,7 +18,8 @@ jobs: go-version: [ 1.21.x ] # Add other versions if needed steps: - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 - name: Set up Go ${{ matrix.go-version }} uses: actions/setup-go@v4 with: @@ -23,11 +27,12 @@ jobs: - name: Install dependencies run: go mod tidy - Lint: + lint: runs-on: ubuntu-latest needs: install-deps steps: - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 - name: Set up Go ${{ matrix.go-version }} uses: actions/setup-go@v4 with: @@ -37,14 +42,50 @@ jobs: - name: Run Profaastinate Lint run: golangci-lint run ./pkg/nexus/... - Test: + test: runs-on: ubuntu-latest needs: install-deps steps: - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 - name: Set up Go ${{ matrix.go-version }} uses: actions/setup-go@v4 with: go-version: ${{ matrix.go-version }} - name: Run Profaastinate Tests - run: go test -cover ./pkg/nexus/... \ No newline at end of file + run: go test -cover ./pkg/nexus/... + + build: + runs-on: ubuntu-latest + needs: + - lint + - test + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-profaastinate + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=sha + latest + + - name: Log in to registry ${{ env.REGISTRY }} + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Make dashboard + run: make dashboard + + - name: Push docker profaastinate image + run: docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-profaastinate:${{ github.sha }} \ No newline at end of file From a0747d1f86637b4cffa9138b869aaf2529c7355d Mon Sep 17 00:00:00 2001 From: konsumgandalf Date: Thu, 11 Jan 2024 01:10:41 +0100 Subject: [PATCH 02/17] feat: add docker build action --- .github/workflows/docker-profaastinate.yaml | 55 +++++++++++++++++++++ .github/workflows/profaastinate.yaml | 38 -------------- 2 files changed, 55 insertions(+), 38 deletions(-) create mode 100644 .github/workflows/docker-profaastinate.yaml diff --git a/.github/workflows/docker-profaastinate.yaml b/.github/workflows/docker-profaastinate.yaml new file mode 100644 index 0000000000..851d8a3e7e --- /dev/null +++ b/.github/workflows/docker-profaastinate.yaml @@ -0,0 +1,55 @@ +name: Validate Profaastinate Nexus + +on: + push: + branches: + - mpga-development + + workflow_dispatch: + +env: + REGISTRY: ghcr.io + IMAGE_NAME: nuclio/dashboard + SET_IMAGE_NAME: nuclio-dashboard-profaastintate + TAG_SUFFIXES: ${{ github.ref_slug }},latest,${{ github.sha }} + +jobs: + install-deps: + runs-on: ubuntu-latest + + strategy: + matrix: + go-version: [ 1.21.x ] # Add other versions if needed + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Set up Go ${{ matrix.go-version }} + uses: actions/setup-go@v4 + with: + go-version: ${{ matrix.go-version }} + - name: Install dependencies + run: go mod tidy + + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Log in to registry ${{ env.REGISTRY }} + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Make dashboard + run: make dashboard + + - name: Tag and push dashboard image + run: | + for tag_suffix in $(echo "${{ env.TAG_SUFFIXES }}" | tr ',' ' '); do + docker tag ${{ env.IMAGE_NAME }}:unstable-arm64-cache ${{ env.REGISTRY }}/${{ env.SET_IMAGE_NAME }}/:${{ tag_suffix }} + docker push ${{ env.REGISTRY }}/${{ env.SET_IMAGE_NAME }}/:${{ tag_suffix }} + done \ No newline at end of file diff --git a/.github/workflows/profaastinate.yaml b/.github/workflows/profaastinate.yaml index 543e8d07cb..7e24d5c3e2 100644 --- a/.github/workflows/profaastinate.yaml +++ b/.github/workflows/profaastinate.yaml @@ -6,9 +6,6 @@ on: workflow_dispatch: -env: - REGISTRY: ghcr.io - jobs: install-deps: runs-on: ubuntu-latest @@ -54,38 +51,3 @@ jobs: go-version: ${{ matrix.go-version }} - name: Run Profaastinate Tests run: go test -cover ./pkg/nexus/... - - build: - runs-on: ubuntu-latest - needs: - - lint - - test - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-profaastinate - tags: | - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=sha - latest - - - name: Log in to registry ${{ env.REGISTRY }} - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Make dashboard - run: make dashboard - - - name: Push docker profaastinate image - run: docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-profaastinate:${{ github.sha }} \ No newline at end of file From c7e332cca51d17bb953b13ff66bf8e3640de945c Mon Sep 17 00:00:00 2001 From: konsumgandalf Date: Thu, 11 Jan 2024 01:16:18 +0100 Subject: [PATCH 03/17] feat: add docker build action --- .github/workflows/docker-profaastinate.yaml | 2 +- pkg/dashboard/server.go | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-profaastinate.yaml b/.github/workflows/docker-profaastinate.yaml index 851d8a3e7e..8e2c513b75 100644 --- a/.github/workflows/docker-profaastinate.yaml +++ b/.github/workflows/docker-profaastinate.yaml @@ -1,4 +1,4 @@ -name: Validate Profaastinate Nexus +name: Build and push dashboard image on: push: diff --git a/pkg/dashboard/server.go b/pkg/dashboard/server.go index 64ec74c22e..ba02d3ebbc 100644 --- a/pkg/dashboard/server.go +++ b/pkg/dashboard/server.go @@ -124,8 +124,7 @@ func NewServer(parentLogger logger.Logger, // create server newServer.AbstractServer, err = restful.NewAbstractServer(parentLogger, DashboardResourceRegistrySingleton, - newServer, - newDockerClient) + newServer) if err != nil { return nil, errors.Wrap(err, "Failed to create restful server") } From d6ec3a6c6587e7613af60f9f396bd4353a28592f Mon Sep 17 00:00:00 2001 From: konsumgandalf Date: Thu, 11 Jan 2024 01:19:13 +0100 Subject: [PATCH 04/17] feat: add docker build action --- .github/workflows/docker-profaastinate.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-profaastinate.yaml b/.github/workflows/docker-profaastinate.yaml index 8e2c513b75..e48976a361 100644 --- a/.github/workflows/docker-profaastinate.yaml +++ b/.github/workflows/docker-profaastinate.yaml @@ -1,12 +1,11 @@ name: Build and push dashboard image on: + workflow_dispatch: push: branches: - mpga-development - workflow_dispatch: - env: REGISTRY: ghcr.io IMAGE_NAME: nuclio/dashboard @@ -50,6 +49,6 @@ jobs: - name: Tag and push dashboard image run: | for tag_suffix in $(echo "${{ env.TAG_SUFFIXES }}" | tr ',' ' '); do - docker tag ${{ env.IMAGE_NAME }}:unstable-arm64-cache ${{ env.REGISTRY }}/${{ env.SET_IMAGE_NAME }}/:${{ tag_suffix }} + docker tag ${{ env.IMAGE_NAME }}:latest-arm64 ${{ env.REGISTRY }}/${{ env.SET_IMAGE_NAME }}/:${{ tag_suffix }} docker push ${{ env.REGISTRY }}/${{ env.SET_IMAGE_NAME }}/:${{ tag_suffix }} done \ No newline at end of file From 5ed10c099430d8e8244ba66257d30db9b024d84e Mon Sep 17 00:00:00 2001 From: konsumgandalf Date: Thu, 11 Jan 2024 01:20:41 +0100 Subject: [PATCH 05/17] feat: add docker build action --- .github/workflows/docker-profaastinate.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-profaastinate.yaml b/.github/workflows/docker-profaastinate.yaml index e48976a361..d8b270d5aa 100644 --- a/.github/workflows/docker-profaastinate.yaml +++ b/.github/workflows/docker-profaastinate.yaml @@ -2,9 +2,8 @@ name: Build and push dashboard image on: workflow_dispatch: - push: - branches: - - mpga-development + pull_request: + branches: [ mpga-development ] env: REGISTRY: ghcr.io From e48a136933ef98634448d93544588e5e36ec3b45 Mon Sep 17 00:00:00 2001 From: konsumgandalf Date: Thu, 11 Jan 2024 01:23:49 +0100 Subject: [PATCH 06/17] feat: add docker build action --- .github/workflows/docker-profaastinate.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-profaastinate.yaml b/.github/workflows/docker-profaastinate.yaml index d8b270d5aa..ac6c13abb5 100644 --- a/.github/workflows/docker-profaastinate.yaml +++ b/.github/workflows/docker-profaastinate.yaml @@ -48,6 +48,6 @@ jobs: - name: Tag and push dashboard image run: | for tag_suffix in $(echo "${{ env.TAG_SUFFIXES }}" | tr ',' ' '); do - docker tag ${{ env.IMAGE_NAME }}:latest-arm64 ${{ env.REGISTRY }}/${{ env.SET_IMAGE_NAME }}/:${{ tag_suffix }} - docker push ${{ env.REGISTRY }}/${{ env.SET_IMAGE_NAME }}/:${{ tag_suffix }} + docker tag ${{ env.IMAGE_NAME }}:latest-amd64 ${{ env.REGISTRY }}/${{ env.SET_IMAGE_NAME }}/${{ tag_suffix }} + docker push ${{ env.REGISTRY }}/${{ env.SET_IMAGE_NAME }}/${{ tag_suffix }} done \ No newline at end of file From c7c59b804774eb11fa7a6451c392868595235e2c Mon Sep 17 00:00:00 2001 From: konsumgandalf Date: Thu, 11 Jan 2024 01:25:23 +0100 Subject: [PATCH 07/17] feat: add docker build action --- .github/workflows/docker-profaastinate.yaml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker-profaastinate.yaml b/.github/workflows/docker-profaastinate.yaml index ac6c13abb5..6a8930f12f 100644 --- a/.github/workflows/docker-profaastinate.yaml +++ b/.github/workflows/docker-profaastinate.yaml @@ -9,15 +9,16 @@ env: REGISTRY: ghcr.io IMAGE_NAME: nuclio/dashboard SET_IMAGE_NAME: nuclio-dashboard-profaastintate - TAG_SUFFIXES: ${{ github.ref_slug }},latest,${{ github.sha }} + TAG_SUFFIXES: ${{ github.ref_name }},latest,${{ github.sha }} jobs: + # Install Go 1.21.x install-deps: runs-on: ubuntu-latest strategy: matrix: - go-version: [ 1.21.x ] # Add other versions if needed + go-version: [ 1.21.x ] steps: - name: Checkout repository @@ -27,8 +28,11 @@ jobs: with: go-version: ${{ matrix.go-version }} - name: Install dependencies - run: go mod tidy + run: | + go version + go mod tidy + # Build and push dashboard image build: runs-on: ubuntu-latest steps: @@ -42,12 +46,13 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Make dashboard - run: make dashboard + - name: Build dashboard image + run: | + docker build -t ${{ env.IMAGE_NAME }}:latest-amd64 . - name: Tag and push dashboard image run: | for tag_suffix in $(echo "${{ env.TAG_SUFFIXES }}" | tr ',' ' '); do docker tag ${{ env.IMAGE_NAME }}:latest-amd64 ${{ env.REGISTRY }}/${{ env.SET_IMAGE_NAME }}/${{ tag_suffix }} docker push ${{ env.REGISTRY }}/${{ env.SET_IMAGE_NAME }}/${{ tag_suffix }} - done \ No newline at end of file + done From d12a8aecff5f7585e35859565fad19a938c93298 Mon Sep 17 00:00:00 2001 From: konsumgandalf Date: Thu, 11 Jan 2024 01:26:28 +0100 Subject: [PATCH 08/17] feat: add docker build action --- .github/workflows/docker-profaastinate.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/docker-profaastinate.yaml b/.github/workflows/docker-profaastinate.yaml index 6a8930f12f..15fe5560ad 100644 --- a/.github/workflows/docker-profaastinate.yaml +++ b/.github/workflows/docker-profaastinate.yaml @@ -9,7 +9,6 @@ env: REGISTRY: ghcr.io IMAGE_NAME: nuclio/dashboard SET_IMAGE_NAME: nuclio-dashboard-profaastintate - TAG_SUFFIXES: ${{ github.ref_name }},latest,${{ github.sha }} jobs: # Install Go 1.21.x @@ -52,7 +51,5 @@ jobs: - name: Tag and push dashboard image run: | - for tag_suffix in $(echo "${{ env.TAG_SUFFIXES }}" | tr ',' ' '); do - docker tag ${{ env.IMAGE_NAME }}:latest-amd64 ${{ env.REGISTRY }}/${{ env.SET_IMAGE_NAME }}/${{ tag_suffix }} + docker tag ${{ env.IMAGE_NAME }}:latest-amd64 ${{ env.REGISTRY }}/${{ env.SET_IMAGE_NAME }}/${{ github.ref_name }} docker push ${{ env.REGISTRY }}/${{ env.SET_IMAGE_NAME }}/${{ tag_suffix }} - done From bdfd3fe8cf2bf2ca77d04e158e35cef632fda587 Mon Sep 17 00:00:00 2001 From: konsumgandalf Date: Thu, 11 Jan 2024 01:26:53 +0100 Subject: [PATCH 09/17] feat: add docker build action --- .github/workflows/docker-profaastinate.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-profaastinate.yaml b/.github/workflows/docker-profaastinate.yaml index 15fe5560ad..f0212c357f 100644 --- a/.github/workflows/docker-profaastinate.yaml +++ b/.github/workflows/docker-profaastinate.yaml @@ -52,4 +52,4 @@ jobs: - name: Tag and push dashboard image run: | docker tag ${{ env.IMAGE_NAME }}:latest-amd64 ${{ env.REGISTRY }}/${{ env.SET_IMAGE_NAME }}/${{ github.ref_name }} - docker push ${{ env.REGISTRY }}/${{ env.SET_IMAGE_NAME }}/${{ tag_suffix }} + docker push ${{ env.REGISTRY }}/${{ env.SET_IMAGE_NAME }}/${{ github.ref_name }} From 508a6ee18bba84f45830e1937af3c7d9d8133d21 Mon Sep 17 00:00:00 2001 From: konsumgandalf Date: Thu, 11 Jan 2024 01:28:23 +0100 Subject: [PATCH 10/17] feat: add docker build action --- .github/workflows/docker-profaastinate.yaml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/docker-profaastinate.yaml b/.github/workflows/docker-profaastinate.yaml index f0212c357f..6a42d170a2 100644 --- a/.github/workflows/docker-profaastinate.yaml +++ b/.github/workflows/docker-profaastinate.yaml @@ -15,21 +15,13 @@ jobs: install-deps: runs-on: ubuntu-latest - strategy: - matrix: - go-version: [ 1.21.x ] - steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Set up Go ${{ matrix.go-version }} + - name: Set up Go uses: actions/setup-go@v4 - with: - go-version: ${{ matrix.go-version }} - name: Install dependencies - run: | - go version - go mod tidy + run: go mod tidy # Build and push dashboard image build: @@ -46,8 +38,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build dashboard image - run: | - docker build -t ${{ env.IMAGE_NAME }}:latest-amd64 . + run: make dashboard - name: Tag and push dashboard image run: | From 8d7eeae62c5936ab21659f14246b4ae5df1b7f9a Mon Sep 17 00:00:00 2001 From: konsumgandalf Date: Thu, 11 Jan 2024 01:29:34 +0100 Subject: [PATCH 11/17] feat: remove unused step --- .github/workflows/docker-profaastinate.yaml | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/.github/workflows/docker-profaastinate.yaml b/.github/workflows/docker-profaastinate.yaml index 6a42d170a2..2c376a80ec 100644 --- a/.github/workflows/docker-profaastinate.yaml +++ b/.github/workflows/docker-profaastinate.yaml @@ -2,7 +2,7 @@ name: Build and push dashboard image on: workflow_dispatch: - pull_request: + push: branches: [ mpga-development ] env: @@ -11,19 +11,6 @@ env: SET_IMAGE_NAME: nuclio-dashboard-profaastintate jobs: - # Install Go 1.21.x - install-deps: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v4 - - name: Install dependencies - run: go mod tidy - - # Build and push dashboard image build: runs-on: ubuntu-latest steps: From 1db5f5136328f17883737376dfed1da8995337fe Mon Sep 17 00:00:00 2001 From: konsumgandalf Date: Thu, 11 Jan 2024 01:41:35 +0100 Subject: [PATCH 12/17] fix: replace wrong prefix --- .github/workflows/docker-profaastinate.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-profaastinate.yaml b/.github/workflows/docker-profaastinate.yaml index 2c376a80ec..6075d376c7 100644 --- a/.github/workflows/docker-profaastinate.yaml +++ b/.github/workflows/docker-profaastinate.yaml @@ -7,7 +7,7 @@ on: env: REGISTRY: ghcr.io - IMAGE_NAME: nuclio/dashboard + IMAGE_NAME: quay.io/nuclio/dashboard SET_IMAGE_NAME: nuclio-dashboard-profaastintate jobs: From e523e1b97fd0540f8e3dbcd7437e3ee772b65313 Mon Sep 17 00:00:00 2001 From: konsumgandalf Date: Thu, 11 Jan 2024 01:43:19 +0100 Subject: [PATCH 13/17] fix: replace wrong prefix --- .github/workflows/docker-profaastinate.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-profaastinate.yaml b/.github/workflows/docker-profaastinate.yaml index 6075d376c7..74746b392b 100644 --- a/.github/workflows/docker-profaastinate.yaml +++ b/.github/workflows/docker-profaastinate.yaml @@ -2,7 +2,7 @@ name: Build and push dashboard image on: workflow_dispatch: - push: + pull_request: branches: [ mpga-development ] env: From 7d0cc4f44c6130dafa8ad05cfdd7a69ac36fc3bd Mon Sep 17 00:00:00 2001 From: konsumgandalf Date: Thu, 11 Jan 2024 02:08:05 +0100 Subject: [PATCH 14/17] fix: replace wrong prefix --- .github/workflows/docker-profaastinate.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-profaastinate.yaml b/.github/workflows/docker-profaastinate.yaml index 74746b392b..53834fe9d3 100644 --- a/.github/workflows/docker-profaastinate.yaml +++ b/.github/workflows/docker-profaastinate.yaml @@ -29,5 +29,5 @@ jobs: - name: Tag and push dashboard image run: | - docker tag ${{ env.IMAGE_NAME }}:latest-amd64 ${{ env.REGISTRY }}/${{ env.SET_IMAGE_NAME }}/${{ github.ref_name }} - docker push ${{ env.REGISTRY }}/${{ env.SET_IMAGE_NAME }}/${{ github.ref_name }} + docker tag ${{ env.IMAGE_NAME }}:latest-amd64 ${{ env.REGISTRY }}/${{ github.repository }}/${{ env.SET_IMAGE_NAME }}:${{ github.ref_name }} + docker push ${{ env.REGISTRY }}/${{ github.repository }}/${{ env.SET_IMAGE_NAME }}:${{ github.ref_name }} From 3512b260f4f2b08fa798a50a9fb7ac2d6d5a80ec Mon Sep 17 00:00:00 2001 From: konsumgandalf Date: Thu, 11 Jan 2024 10:14:27 +0100 Subject: [PATCH 15/17] fix: replace wrong prefix --- .github/workflows/docker-profaastinate.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-profaastinate.yaml b/.github/workflows/docker-profaastinate.yaml index 53834fe9d3..a1718fe679 100644 --- a/.github/workflows/docker-profaastinate.yaml +++ b/.github/workflows/docker-profaastinate.yaml @@ -29,5 +29,5 @@ jobs: - name: Tag and push dashboard image run: | - docker tag ${{ env.IMAGE_NAME }}:latest-amd64 ${{ env.REGISTRY }}/${{ github.repository }}/${{ env.SET_IMAGE_NAME }}:${{ github.ref_name }} - docker push ${{ env.REGISTRY }}/${{ github.repository }}/${{ env.SET_IMAGE_NAME }}:${{ github.ref_name }} + docker tag ${{ env.IMAGE_NAME }}:latest-amd64 ${{ env.REGISTRY }}/${{ github.repository }}/${{ env.SET_IMAGE_NAME }}:latest-amd64 + docker push ${{ env.REGISTRY }}/${{ github.repository }}/$}{ env.SET_IMAGE_NAME }}:latest-amd64 From 5fdc7b5a503c59767522392428d2828c1bb28d1e Mon Sep 17 00:00:00 2001 From: konsumgandalf Date: Thu, 11 Jan 2024 10:25:54 +0100 Subject: [PATCH 16/17] fix: replace wrong prefix --- .github/workflows/docker-profaastinate.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-profaastinate.yaml b/.github/workflows/docker-profaastinate.yaml index a1718fe679..d46932ba27 100644 --- a/.github/workflows/docker-profaastinate.yaml +++ b/.github/workflows/docker-profaastinate.yaml @@ -30,4 +30,4 @@ jobs: - name: Tag and push dashboard image run: | docker tag ${{ env.IMAGE_NAME }}:latest-amd64 ${{ env.REGISTRY }}/${{ github.repository }}/${{ env.SET_IMAGE_NAME }}:latest-amd64 - docker push ${{ env.REGISTRY }}/${{ github.repository }}/$}{ env.SET_IMAGE_NAME }}:latest-amd64 + docker push ${{ env.REGISTRY }}/${{ github.repository }}/${{ env.SET_IMAGE_NAME }}:latest-amd64 From 94180ed9e6ce2092794fa20294cad458f990e485 Mon Sep 17 00:00:00 2001 From: konsumgandalf Date: Thu, 25 Jan 2024 20:30:03 +0100 Subject: [PATCH 17/17] refactor(pkg-nexus): elastic deployer Move running and paused status to deployer models since it can be reused for kuberclient. --- pkg/nexus/elastic-deploy/docker/docker-deployer.go | 13 ++++--------- .../models/pro-elastic-deployer-structs.go | 5 +++++ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pkg/nexus/elastic-deploy/docker/docker-deployer.go b/pkg/nexus/elastic-deploy/docker/docker-deployer.go index 7445e1e1d4..cf2077288b 100644 --- a/pkg/nexus/elastic-deploy/docker/docker-deployer.go +++ b/pkg/nexus/elastic-deploy/docker/docker-deployer.go @@ -8,11 +8,6 @@ import ( "time" ) -const ( - running = "running" - paused = "paused" -) - type DockerDeployer struct { *deployer_models.ProElasticDeployerConfig *docker.Client @@ -73,7 +68,7 @@ func (ds *DockerDeployer) Unpause(functionName string) error { } fmt.Println("Container state: ", container.State) - if container.State == paused { + if container.State == deployer_models.Paused { err := ds.UnpauseContainer(container.ID) if err != nil { return err @@ -90,12 +85,12 @@ func (ds *DockerDeployer) Unpause(functionName string) error { func (ds *DockerDeployer) Pause(functionName string) error { container := ds.getFunctionContainer(functionName) - if container.State == paused { + if container.State == deployer_models.Paused { fmt.Printf("Container %s has been paused already\n", ds.getContainerName(functionName)) return nil } - if container.State == running { + if container.State == deployer_models.Running { err := ds.PauseContainer(container.ID) if err != nil { return err @@ -110,7 +105,7 @@ func (ds *DockerDeployer) Pause(functionName string) error { func (ds *DockerDeployer) IsRunning(functionName string) bool { container := ds.getFunctionContainer(functionName) - return container.State == running + return container.State == deployer_models.Running } func (ds *DockerDeployer) getFunctionContainer(functionName string) *docker.APIContainers { diff --git a/pkg/nexus/elastic-deploy/models/pro-elastic-deployer-structs.go b/pkg/nexus/elastic-deploy/models/pro-elastic-deployer-structs.go index a0bd205e0b..4c5b6d68b4 100644 --- a/pkg/nexus/elastic-deploy/models/pro-elastic-deployer-structs.go +++ b/pkg/nexus/elastic-deploy/models/pro-elastic-deployer-structs.go @@ -4,6 +4,11 @@ import ( "time" ) +const ( + Running = "Running" + Paused = "Paused" +) + type ElasticDeployer interface { Unpause(functionName string) error Pause(functionName string) error