-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KUBE-503: adjust Github workflows, adjust for latest Proto definition…
…s and add e2e test (#3)
- Loading branch information
Showing
36 changed files
with
1,165 additions
and
661 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,43 +57,64 @@ jobs: | |
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
# TODO: uncomment after Helm chart is released | ||
# - name: Create k8s Kind Cluster | ||
# uses: helm/kind-action@v1 | ||
# with: | ||
# cluster_name: cloud-proxy-e2e | ||
|
||
# - uses: azure/[email protected] | ||
|
||
# - name: Run e2e tests | ||
# run: | | ||
# echo "$GCP_CREDENTIALS_JSON" > "$GCP_CREDENTIALS" | ||
# ./e2e/run.sh | ||
# env: | ||
# GCP_CREDENTIALS_JSON: ${{ secrets.TEST_GCP_CREDENTIALS }} | ||
# GCP_CREDENTIALS: gcp-credentials.json | ||
|
||
- name: Login to Google Artifact Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: us-docker.pkg.dev | ||
username: _json_key | ||
password: ${{ secrets.ARTIFACT_BUILDER_JSON_KEY }} | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
if: ${{ github.event_name == 'pull_request' }} | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push pr | ||
if: github.event_name == 'pull_request' | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
platforms: linux/arm64,linux/amd64 | ||
push: ${{ github.event_name == 'pull_request' }} | ||
tags: ghcr.io/castai/cloud-proxy:${{ github.sha }} | ||
|
||
- name: Build and push main | ||
if: github.event_name != 'release' | ||
uses: docker/build-push-action@v3 | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: true | ||
platforms: linux/arm64,linux/amd64 | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: | | ||
us-docker.pkg.dev/castai-hub/library/cloud-proxy:${{ github.sha }} | ||
- name: Build and push release | ||
if: github.event_name == 'release' | ||
uses: docker/build-push-action@v3 | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: true | ||
platforms: linux/arm64,linux/amd64 | ||
push: true | ||
tags: | | ||
us-docker.pkg.dev/castai-hub/library/cloud-proxy:${{ env.RELEASE_TAG }} | ||
us-docker.pkg.dev/castai-hub/library/cloud-proxy:latest | ||
#- name: Docker pull for fossa main | ||
# if: github.event_name == 'release' | ||
# run: docker pull us-docker.pkg.dev/castai-hub/library/cloud-proxy:${{ env.RELEASE_TAG }} | ||
# | ||
#- name: FOSSA scan docker image | ||
# if: github.event_name == 'release' | ||
# continue-on-error: true | ||
# uses: fossas/fossa-action@v1 | ||
# with: | ||
# api-key: ${{ secrets.FOSSA_API_KEY }} | ||
# container: us-docker.pkg.dev/castai-hub/library/cloud-proxy:${{ env.RELEASE_TAG }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM gcr.io/distroless/static-debian11 | ||
FROM gcr.io/distroless/static-debian11:nonroot | ||
|
||
ARG TARGETARCH="amd64" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,28 @@ | ||
VERSION ?= poc2 | ||
REPO ?= lachezarcast/cloud-proxy | ||
VERSION ?= latest | ||
REPO ?= us-docker.pkg.dev/castai-hub/library/cloud-proxy | ||
|
||
build: | ||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o bin/castai-cloud-proxy-amd64 ./cmd/proxy | ||
#docker build -t us-docker.pkg.dev/castai-hub/library/svc:$(VERSION) . | ||
docker build -t $(REPO):$(VERSION) --platform linux/amd64 . | ||
.PHONY: build | ||
|
||
push: | ||
docker push $(REPO):$(VERSION) | ||
.PHONY: push | ||
|
||
release: build push | ||
.PHONY: release | ||
|
||
deploy: build push | ||
# Get the latest digest because it doesn't work for some f. reason and put it in the yaml | ||
@DIGEST=$$(docker inspect --format='{{index .RepoDigests 0}}' $(REPO):$(VERSION) | awk -F@ '{print $$2}'); \ | ||
sed "s/{{IMAGE_DIGEST}}/$${DIGEST}/g" dummy_deploy.yaml > tmp.yaml | ||
kubectl apply -f tmp.yaml | ||
rm tmp.yaml | ||
|
||
.PHONY: deploy | ||
|
||
generate-grpc: | ||
protoc --go_out=./internal/castai/proto --go-grpc_out=./internal/castai/proto ./internal/castai/proto/proxy.proto | ||
.PHONY: generate-grpc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.