-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat: include Init Process in the Toolkit image * feat: copy the Toolkit binary to the volume * feat: copy only the Busybox binaries from Toolkit image * chore: clean up actions optimization code a bit * chore: don't process setup step in action optimizations * feat: add `pure` flag for the ContainerStage to define if it can be combined with other container * feat: fit pure operations in TestWorkflow into other containers * fix: ensure timestamps for step results in case of aborting * feat: make `fetch` operation pure too * chore: delete obsolete comments * fix: unit tests and bugfixes * fix: use proper image for setup step
- Loading branch information
Showing
33 changed files
with
957 additions
and
582 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
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
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,6 +1,7 @@ | ||
# syntax=docker/dockerfile:1 | ||
ARG BUSYBOX_IMAGE | ||
FROM ${BUSYBOX_IMAGE} | ||
RUN cp -rf /bin /.tktw-bin | ||
COPY testworkflow-init /init | ||
USER 1001 | ||
ENTRYPOINT ["/init"] |
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,8 +1,13 @@ | ||
# syntax=docker/dockerfile:1 | ||
ARG BUSYBOX_IMAGE | ||
ARG ALPINE_IMAGE | ||
|
||
FROM ${BUSYBOX_IMAGE} AS busybox | ||
FROM ${ALPINE_IMAGE} | ||
RUN apk --no-cache add ca-certificates libssl3 git openssh-client | ||
COPY --from=busybox /bin /.tktw-bin | ||
COPY testworkflow-toolkit /toolkit | ||
COPY testworkflow-init /init | ||
RUN adduser --disabled-password --home / --no-create-home --uid 1001 default | ||
USER 1001 | ||
ENTRYPOINT ["/toolkit"] |
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
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
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
112 changes: 112 additions & 0 deletions
112
goreleaser_files/.goreleaser-docker-build-testworkflow-toolkit.yml
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 |
---|---|---|
@@ -0,0 +1,112 @@ | ||
version: 2 | ||
env: | ||
# Goreleaser always uses the docker buildx builder with name "default"; see | ||
# https://github.com/goreleaser/goreleaser/pull/3199 | ||
# To use a builder other than "default", set this variable. | ||
# Necessary for, e.g., GitHub actions cache integration. | ||
- DOCKER_REPO={{ if index .Env "DOCKER_REPO" }}{{ .Env.DOCKER_REPO }}{{ else }}kubeshop{{ end }} | ||
- DOCKER_BUILDX_BUILDER={{ if index .Env "DOCKER_BUILDX_BUILDER" }}{{ .Env.DOCKER_BUILDX_BUILDER }}{{ else }}default{{ end }} | ||
# Setup to enable Docker to use, e.g., the GitHub actions cache; see | ||
# https://docs.docker.com/build/building/cache/backends/ | ||
# https://github.com/moby/buildkit#export-cache | ||
- DOCKER_BUILDX_CACHE_FROM={{ if index .Env "DOCKER_BUILDX_CACHE_FROM" }}{{ .Env.DOCKER_BUILDX_CACHE_FROM }}{{ else }}type=registry{{ end }} | ||
- DOCKER_BUILDX_CACHE_TO={{ if index .Env "DOCKER_BUILDX_CACHE_TO" }}{{ .Env.DOCKER_BUILDX_CACHE_TO }}{{ else }}type=inline{{ end }} | ||
# Build image with commit sha tag | ||
- IMAGE_TAG_SHA={{ if index .Env "IMAGE_TAG_SHA" }}{{ .Env.IMAGE_TAG_SHA }}{{ else }}{{ end }} | ||
# Build Sandbox Image | ||
- SANDBOX_IMAGE={{ if index .Env "SANDBOX_IMAGE" }}{{ .Env.SANDBOX_IMAGE }}{{ else }}{{ end }} | ||
- DOCKER_IMAGE_TITLE={{ if index .Env "SANDBOX_IMAGE" }}testkube-sandbox-{{ .Env.SERVICE }}{{ else }}{{ .Env.REPOSITORY }}{{ end }} | ||
- DOCKER_IMAGE_URL={{ if index .Env "SANDBOX_IMAGE" }}https://hub.docker.com/r/kubeshop/testkube-sandbox{{ else }}https://hub.docker.com/r/kubeshop/{{ .Env.REPOSITORY }}{{ end }} | ||
builds: | ||
- id: "linux-init" | ||
main: "./cmd/testworkflow-init" | ||
binary: "testworkflow-init" | ||
env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
mod_timestamp: "{{ .CommitTimestamp }}" | ||
ldflags: | ||
-X github.com/kubeshop/testkube/pkg/version.Version={{ .Version }} | ||
-X github.com/kubeshop/testkube/pkg/version.Commit={{ .FullCommit }} | ||
-s -w | ||
- id: "linux-toolkit" | ||
main: "./cmd/testworkflow-toolkit" | ||
binary: "testworkflow-toolkit" | ||
env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
mod_timestamp: "{{ .CommitTimestamp }}" | ||
ldflags: | ||
-X github.com/kubeshop/testkube/pkg/version.Version={{ .Version }} | ||
-X github.com/kubeshop/testkube/pkg/version.Commit={{ .FullCommit }} | ||
-s -w | ||
dockers: | ||
- dockerfile: ./build/testworkflow-toolkit/Dockerfile | ||
use: buildx | ||
goos: linux | ||
goarch: amd64 | ||
image_templates: | ||
- "{{ if .Env.IMAGE_TAG_SHA }}{{ .Env.DOCKER_REPO }}/{{ .Env.REPOSITORY }}:{{ .ShortCommit }}{{ end }}" | ||
- "{{ if not .Env.IMAGE_TAG_SHA }}{{ .Env.DOCKER_REPO }}/{{ .Env.REPOSITORY }}:{{ .Version }}-amd64{{ end }}" | ||
- "{{ if .Env.SANDBOX_IMAGE }}{{ .Env.DOCKER_REPO }}/testkube-sandbox:{{ .Env.SERVICE }}-{{ .Env.BRANCH_IDENTIFIER }}-{{ .ShortCommit }}{{ end }}" | ||
build_flag_templates: | ||
- "--platform=linux/amd64" | ||
- "--label=org.opencontainers.image.title={{ .Env.DOCKER_IMAGE_TITLE }}" | ||
- "--label=org.opencontainers.image.url={{ .Env.DOCKER_IMAGE_URL }}" | ||
- "--label=org.opencontainers.image.created={{ .Date}}" | ||
- "--label=org.opencontainers.image.revision={{ .FullCommit }}" | ||
- "--label=org.opencontainers.image.version={{ .Version }}" | ||
- "--builder={{ .Env.DOCKER_BUILDX_BUILDER }}" | ||
- "--cache-to={{ .Env.DOCKER_BUILDX_CACHE_TO }}" | ||
- "--cache-from={{ .Env.DOCKER_BUILDX_CACHE_FROM }}" | ||
- "--build-arg=ALPINE_IMAGE={{ .Env.ALPINE_IMAGE }}" | ||
- "--build-arg=BUSYBOX_IMAGE={{ .Env.BUSYBOX_IMAGE }}" | ||
|
||
- dockerfile: ./build/testworkflow-toolkit/Dockerfile | ||
use: buildx | ||
goos: linux | ||
goarch: arm64 | ||
image_templates: | ||
- "{{ if not .Env.IMAGE_TAG_SHA }}{{ .Env.DOCKER_REPO }}/{{ .Env.REPOSITORY }}:{{ .Version }}-arm64v8{{ end }}" | ||
build_flag_templates: | ||
- "--platform=linux/arm64/v8" | ||
- "--label=org.opencontainers.image.created={{ .Date }}" | ||
- "--label=org.opencontainers.image.title={{ .ProjectName }}" | ||
- "--label=org.opencontainers.image.revision={{ .FullCommit }}" | ||
- "--label=org.opencontainers.image.version={{ .Version }}" | ||
- "--builder={{ .Env.DOCKER_BUILDX_BUILDER }}" | ||
- "--cache-to={{ .Env.DOCKER_BUILDX_CACHE_TO }}" | ||
- "--cache-from={{ .Env.DOCKER_BUILDX_CACHE_FROM }}" | ||
- "--build-arg=ALPINE_IMAGE={{ .Env.ALPINE_IMAGE }}" | ||
- "--build-arg=BUSYBOX_IMAGE={{ .Env.BUSYBOX_IMAGE }}" | ||
|
||
docker_manifests: | ||
- name_template: "{{ if not .Env.IMAGE_TAG_SHA }}{{ .Env.DOCKER_REPO }}/{{ .Env.REPOSITORY }}:{{ .Version }}{{ end }}" | ||
image_templates: | ||
- "{{ if not .Env.IMAGE_TAG_SHA }}{{ .Env.DOCKER_REPO }}/{{ .Env.REPOSITORY }}:{{ .Version }}-amd64{{ end }}" | ||
- "{{ if not .Env.IMAGE_TAG_SHA }}{{ .Env.DOCKER_REPO }}/{{ .Env.REPOSITORY }}:{{ .Version }}-arm64v8{{ end }}" | ||
- name_template: "{{ if not .Env.IMAGE_TAG_SHA }}{{ .Env.DOCKER_REPO }}/{{ .Env.REPOSITORY }}:latest{{ end }}" | ||
image_templates: | ||
- "{{ if not .Env.IMAGE_TAG_SHA }}{{ .Env.DOCKER_REPO }}/{{ .Env.REPOSITORY }}:{{ .Version }}-amd64{{ end }}" | ||
- "{{ if not .Env.IMAGE_TAG_SHA }}{{ .Env.DOCKER_REPO }}/{{ .Env.REPOSITORY }}:{{ .Version }}-arm64v8{{ end }}" | ||
|
||
|
||
release: | ||
disable: true | ||
|
||
docker_signs: | ||
- cmd: cosign | ||
artifacts: all | ||
output: true | ||
args: | ||
- "sign" | ||
- "${artifact}" | ||
- "--yes" |
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
Oops, something went wrong.