Compare commits

..

No commits in common. "328b2ba52014c0cf6612e53319d2391ce75deec2" and "e7b6dc905982ab2995d4d995cc3d34b9868fe669" have entirely different histories.

6 changed files with 82 additions and 209 deletions

View File

@ -69,72 +69,42 @@ spec:
value: $(params.PULL_BASE_SHA) value: $(params.PULL_BASE_SHA)
- name: deleteExisting - name: deleteExisting
value: "true" value: "true"
- name: get-git-commit-time
taskSpec:
metadata: {}
stepTemplate:
image: alpine:3.20
computeResources:
requests:
cpu: 10m
memory: 600Mi
workingDir: "$(workspaces.repo.path)"
results:
- name: unix-time
description: The time of the git commit in unix timestamp format.
steps:
- image: alpine/git:v2.34.2
name: detect-tag-step
script: |
#!/usr/bin/env sh
set -euo pipefail
echo -n "$(git log -1 --pretty=%ct)" | tee $(results.unix-time.path)
workspaces:
- name: repo
workspace: git-source
runAfter:
- fetch-repository
- name: build-image - name: build-image
taskRef: taskRef:
resolver: git resolver: git
params: params:
- name: url - name: url
value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git value: https://code.fizz.buzz/mirror/catalog.git # mirror of https://github.com/tektoncd/catalog.git
- name: revision - name: revision
value: 7ee31a185243ee6da13dcd26a592c585b64c80e5 value: df36b3853a5657fd883015cdbf07ad6466918acf
- name: pathInRepo - name: pathInRepo
value: task/buildkit-rootless-daemonless/0.1/buildkit-rootless-daemonless.yaml value: task/kaniko/0.6/kaniko.yaml
params: params:
- name: OUTPUT - name: IMAGE
value: >- value: "$(params.image-name):$(tasks.fetch-repository.results.commit)"
type=image,"name=$(params.image-name):latest,$(params.image-name):$(tasks.fetch-repository.results.commit)",push=true,compression=zstd,compression-level=22,oci-mediatypes=true
- name: CONTEXT - name: CONTEXT
value: $(params.path-to-image-context) value: $(params.path-to-image-context)
- name: DOCKERFILE - name: DOCKERFILE
value: $(params.path-to-dockerfile) value: $(params.path-to-dockerfile)
- name: BUILDER_IMAGE
value: "gcr.io/kaniko-project/executor:v1.23.2"
- name: EXTRA_ARGS - name: EXTRA_ARGS
value: value:
- --import-cache - "--destination=$(params.image-name)" # Also write the :latest image
- "type=registry,ref=$(params.image-name):buildcache" - "--target=$(params.target-name)"
- --export-cache - --cache=true
- "type=registry,ref=$(params.image-name):buildcache,mode=max,compression=zstd,compression-level=22,rewrite-timestamp=true,image-manifest=true,oci-mediatypes=true" - --cache-copy-layers
- --opt - --cache-repo=harbor.fizz.buzz/kanikocache/cache
- build-arg:SOURCE_DATE_EPOCH=$(tasks.get-git-commit-time.results.unix-time) - --use-new-run # Should result in a speed-up
- name: BUILDKITD_TOML - --reproducible # To remove timestamps so layer caching works.
value: | - --snapshot-mode=redo
debug = true - --skip-unused-stages=true
[registry."docker.io"] - --registry-mirror=dockerhub.dockerhub.svc.cluster.local
mirrors = ["dockerhub.dockerhub.svc.cluster.local"]
[registry."dockerhub.dockerhub.svc.cluster.local"]
http = true
insecure = true
workspaces: workspaces:
- name: source - name: source
workspace: git-source workspace: git-source
- name: dockerconfig - name: dockerconfig
workspace: docker-credentials workspace: docker-credentials
runAfter:
- fetch-repository
finally: finally:
- name: report-success - name: report-success
when: when:
@ -219,4 +189,4 @@ spec:
- name: path-to-image-context - name: path-to-image-context
value: . value: .
- name: path-to-dockerfile - name: path-to-dockerfile
value: docker/natter/ value: docker/natter/Dockerfile

View File

@ -69,72 +69,41 @@ spec:
value: $(params.PULL_BASE_SHA) value: $(params.PULL_BASE_SHA)
- name: deleteExisting - name: deleteExisting
value: "true" value: "true"
- name: get-git-commit-time
taskSpec:
metadata: {}
stepTemplate:
image: alpine:3.20
computeResources:
requests:
cpu: 10m
memory: 600Mi
workingDir: "$(workspaces.repo.path)"
results:
- name: unix-time
description: The time of the git commit in unix timestamp format.
steps:
- image: alpine/git:v2.34.2
name: detect-tag-step
script: |
#!/usr/bin/env sh
set -euo pipefail
echo -n "$(git log -1 --pretty=%ct)" | tee $(results.unix-time.path)
workspaces:
- name: repo
workspace: git-source
runAfter:
- fetch-repository
- name: build-image - name: build-image
taskRef: taskRef:
resolver: git resolver: git
params: params:
- name: url - name: url
value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git value: https://code.fizz.buzz/mirror/catalog.git # mirror of https://github.com/tektoncd/catalog.git
- name: revision - name: revision
value: 7ee31a185243ee6da13dcd26a592c585b64c80e5 value: df36b3853a5657fd883015cdbf07ad6466918acf
- name: pathInRepo - name: pathInRepo
value: task/buildkit-rootless-daemonless/0.1/buildkit-rootless-daemonless.yaml value: task/kaniko/0.6/kaniko.yaml
params: params:
- name: OUTPUT - name: IMAGE
value: >- value: "$(params.image-name):$(tasks.fetch-repository.results.commit)"
type=image,"name=$(params.image-name):latest,$(params.image-name):$(tasks.fetch-repository.results.commit)",push=true,compression=zstd,compression-level=22,oci-mediatypes=true
- name: CONTEXT - name: CONTEXT
value: $(params.path-to-image-context) value: $(params.path-to-image-context)
- name: DOCKERFILE - name: DOCKERFILE
value: $(params.path-to-dockerfile) value: $(params.path-to-dockerfile)
- name: BUILDER_IMAGE
value: "gcr.io/kaniko-project/executor:v1.23.2"
- name: EXTRA_ARGS - name: EXTRA_ARGS
value: value:
- --import-cache - "--target=$(params.target-name)"
- "type=registry,ref=$(params.image-name):buildcache" - --cache=true
- --export-cache - --cache-copy-layers
- "type=registry,ref=$(params.image-name):buildcache,mode=max,compression=zstd,compression-level=22,rewrite-timestamp=true,image-manifest=true,oci-mediatypes=true" - --cache-repo=harbor.fizz.buzz/kanikocache/cache
- --opt - --use-new-run # Should result in a speed-up
- build-arg:SOURCE_DATE_EPOCH=$(tasks.get-git-commit-time.results.unix-time) - --reproducible # To remove timestamps so layer caching works.
- name: BUILDKITD_TOML - --snapshot-mode=redo
value: | - --skip-unused-stages=true
debug = true - --registry-mirror=dockerhub.dockerhub.svc.cluster.local
[registry."docker.io"]
mirrors = ["dockerhub.dockerhub.svc.cluster.local"]
[registry."dockerhub.dockerhub.svc.cluster.local"]
http = true
insecure = true
workspaces: workspaces:
- name: source - name: source
workspace: git-source workspace: git-source
- name: dockerconfig - name: dockerconfig
workspace: docker-credentials workspace: docker-credentials
runAfter:
- fetch-repository
- name: run-cargo-fmt - name: run-cargo-fmt
taskSpec: taskSpec:
metadata: {} metadata: {}
@ -174,7 +143,7 @@ spec:
- build-image - build-image
params: params:
- name: docker-image - name: docker-image
value: "$(tasks.build-image.results.IMAGE_URL[1])" value: "$(params.image-name):$(tasks.fetch-repository.results.commit)"
- name: run-prettier - name: run-prettier
taskSpec: taskSpec:
metadata: {} metadata: {}
@ -208,7 +177,7 @@ spec:
- build-image - build-image
params: params:
- name: docker-image - name: docker-image
value: "$(tasks.build-image.results.IMAGE_URL[1])" value: "$(params.image-name):$(tasks.fetch-repository.results.commit)"
- name: commit-changes - name: commit-changes
taskRef: taskRef:
resolver: git resolver: git
@ -334,7 +303,7 @@ spec:
workspace: cargo-cache workspace: cargo-cache
params: params:
- name: docker-image - name: docker-image
value: "$(tasks.build-image.results.IMAGE_URL[1])" value: "$(params.image-name):$(tasks.fetch-repository.results.commit)"
workspaces: workspaces:
- name: git-source - name: git-source
- name: docker-credentials - name: docker-credentials
@ -364,4 +333,4 @@ spec:
- name: path-to-image-context - name: path-to-image-context
value: docker/natter_development/ value: docker/natter_development/
- name: path-to-dockerfile - name: path-to-dockerfile
value: docker/natter_development/ value: docker/natter_development/Dockerfile

View File

@ -69,72 +69,41 @@ spec:
value: $(params.PULL_BASE_SHA) value: $(params.PULL_BASE_SHA)
- name: deleteExisting - name: deleteExisting
value: "true" value: "true"
- name: get-git-commit-time
taskSpec:
metadata: {}
stepTemplate:
image: alpine:3.20
computeResources:
requests:
cpu: 10m
memory: 600Mi
workingDir: "$(workspaces.repo.path)"
results:
- name: unix-time
description: The time of the git commit in unix timestamp format.
steps:
- image: alpine/git:v2.34.2
name: detect-tag-step
script: |
#!/usr/bin/env sh
set -euo pipefail
echo -n "$(git log -1 --pretty=%ct)" | tee $(results.unix-time.path)
workspaces:
- name: repo
workspace: git-source
runAfter:
- fetch-repository
- name: build-image - name: build-image
taskRef: taskRef:
resolver: git resolver: git
params: params:
- name: url - name: url
value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git value: https://code.fizz.buzz/mirror/catalog.git # mirror of https://github.com/tektoncd/catalog.git
- name: revision - name: revision
value: 7ee31a185243ee6da13dcd26a592c585b64c80e5 value: df36b3853a5657fd883015cdbf07ad6466918acf
- name: pathInRepo - name: pathInRepo
value: task/buildkit-rootless-daemonless/0.1/buildkit-rootless-daemonless.yaml value: task/kaniko/0.6/kaniko.yaml
params: params:
- name: OUTPUT - name: IMAGE
value: >- value: "$(params.image-name):$(tasks.fetch-repository.results.commit)"
type=image,"name=$(params.image-name):latest,$(params.image-name):$(tasks.fetch-repository.results.commit)",push=true,compression=zstd,compression-level=22,oci-mediatypes=true
- name: CONTEXT - name: CONTEXT
value: $(params.path-to-image-context) value: $(params.path-to-image-context)
- name: DOCKERFILE - name: DOCKERFILE
value: $(params.path-to-dockerfile) value: $(params.path-to-dockerfile)
- name: BUILDER_IMAGE
value: "gcr.io/kaniko-project/executor:v1.23.2"
- name: EXTRA_ARGS - name: EXTRA_ARGS
value: value:
- --import-cache - "--target=$(params.target-name)"
- "type=registry,ref=$(params.image-name):buildcache" - --cache=true
- --export-cache - --cache-copy-layers
- "type=registry,ref=$(params.image-name):buildcache,mode=max,compression=zstd,compression-level=22,rewrite-timestamp=true,image-manifest=true,oci-mediatypes=true" - --cache-repo=harbor.fizz.buzz/kanikocache/cache
- --opt - --use-new-run # Should result in a speed-up
- build-arg:SOURCE_DATE_EPOCH=$(tasks.get-git-commit-time.results.unix-time) - --reproducible # To remove timestamps so layer caching works.
- name: BUILDKITD_TOML - --snapshot-mode=redo
value: | - --skip-unused-stages=true
debug = true - --registry-mirror=dockerhub.dockerhub.svc.cluster.local
[registry."docker.io"]
mirrors = ["dockerhub.dockerhub.svc.cluster.local"]
[registry."dockerhub.dockerhub.svc.cluster.local"]
http = true
insecure = true
workspaces: workspaces:
- name: source - name: source
workspace: git-source workspace: git-source
- name: dockerconfig - name: dockerconfig
workspace: docker-credentials workspace: docker-credentials
runAfter:
- fetch-repository
- name: run-cargo-clippy - name: run-cargo-clippy
taskSpec: taskSpec:
metadata: {} metadata: {}
@ -184,7 +153,7 @@ spec:
- build-image - build-image
params: params:
- name: docker-image - name: docker-image
value: "$(tasks.build-image.results.IMAGE_URL[1])" value: "$(params.image-name):$(tasks.fetch-repository.results.commit)"
finally: finally:
- name: report-success - name: report-success
when: when:
@ -278,7 +247,7 @@ spec:
workspace: cargo-cache workspace: cargo-cache
params: params:
- name: docker-image - name: docker-image
value: "$(tasks.build-image.results.IMAGE_URL[1])" value: "$(params.image-name):$(tasks.fetch-repository.results.commit)"
workspaces: workspaces:
- name: git-source - name: git-source
- name: docker-credentials - name: docker-credentials
@ -308,4 +277,4 @@ spec:
- name: path-to-image-context - name: path-to-image-context
value: docker/natter_development/ value: docker/natter_development/
- name: path-to-dockerfile - name: path-to-dockerfile
value: docker/natter_development/ value: docker/natter_development/Dockerfile

View File

@ -69,72 +69,41 @@ spec:
value: $(params.PULL_BASE_SHA) value: $(params.PULL_BASE_SHA)
- name: deleteExisting - name: deleteExisting
value: "true" value: "true"
- name: get-git-commit-time
taskSpec:
metadata: {}
stepTemplate:
image: alpine:3.20
computeResources:
requests:
cpu: 10m
memory: 600Mi
workingDir: "$(workspaces.repo.path)"
results:
- name: unix-time
description: The time of the git commit in unix timestamp format.
steps:
- image: alpine/git:v2.34.2
name: detect-tag-step
script: |
#!/usr/bin/env sh
set -euo pipefail
echo -n "$(git log -1 --pretty=%ct)" | tee $(results.unix-time.path)
workspaces:
- name: repo
workspace: git-source
runAfter:
- fetch-repository
- name: build-image - name: build-image
taskRef: taskRef:
resolver: git resolver: git
params: params:
- name: url - name: url
value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git value: https://code.fizz.buzz/mirror/catalog.git # mirror of https://github.com/tektoncd/catalog.git
- name: revision - name: revision
value: 7ee31a185243ee6da13dcd26a592c585b64c80e5 value: df36b3853a5657fd883015cdbf07ad6466918acf
- name: pathInRepo - name: pathInRepo
value: task/buildkit-rootless-daemonless/0.1/buildkit-rootless-daemonless.yaml value: task/kaniko/0.6/kaniko.yaml
params: params:
- name: OUTPUT - name: IMAGE
value: >- value: "$(params.image-name):$(tasks.fetch-repository.results.commit)"
type=image,"name=$(params.image-name):latest,$(params.image-name):$(tasks.fetch-repository.results.commit)",push=true,compression=zstd,compression-level=22,oci-mediatypes=true
- name: CONTEXT - name: CONTEXT
value: $(params.path-to-image-context) value: $(params.path-to-image-context)
- name: DOCKERFILE - name: DOCKERFILE
value: $(params.path-to-dockerfile) value: $(params.path-to-dockerfile)
- name: BUILDER_IMAGE
value: "gcr.io/kaniko-project/executor:v1.23.2"
- name: EXTRA_ARGS - name: EXTRA_ARGS
value: value:
- --import-cache - "--target=$(params.target-name)"
- "type=registry,ref=$(params.image-name):buildcache" - --cache=true
- --export-cache - --cache-copy-layers
- "type=registry,ref=$(params.image-name):buildcache,mode=max,compression=zstd,compression-level=22,rewrite-timestamp=true,image-manifest=true,oci-mediatypes=true" - --cache-repo=harbor.fizz.buzz/kanikocache/cache
- --opt - --use-new-run # Should result in a speed-up
- build-arg:SOURCE_DATE_EPOCH=$(tasks.get-git-commit-time.results.unix-time) - --reproducible # To remove timestamps so layer caching works.
- name: BUILDKITD_TOML - --snapshot-mode=redo
value: | - --skip-unused-stages=true
debug = true - --registry-mirror=dockerhub.dockerhub.svc.cluster.local
[registry."docker.io"]
mirrors = ["dockerhub.dockerhub.svc.cluster.local"]
[registry."dockerhub.dockerhub.svc.cluster.local"]
http = true
insecure = true
workspaces: workspaces:
- name: source - name: source
workspace: git-source workspace: git-source
- name: dockerconfig - name: dockerconfig
workspace: docker-credentials workspace: docker-credentials
runAfter:
- fetch-repository
- name: run-cargo-test - name: run-cargo-test
taskSpec: taskSpec:
metadata: {} metadata: {}
@ -174,7 +143,7 @@ spec:
- build-image - build-image
params: params:
- name: docker-image - name: docker-image
value: "$(tasks.build-image.results.IMAGE_URL[1])" value: "$(params.image-name):$(tasks.fetch-repository.results.commit)"
finally: finally:
- name: report-success - name: report-success
when: when:
@ -268,7 +237,7 @@ spec:
workspace: cargo-cache workspace: cargo-cache
params: params:
- name: docker-image - name: docker-image
value: "$(tasks.build-image.results.IMAGE_URL[1])" value: "$(params.image-name):$(tasks.fetch-repository.results.commit)"
workspaces: workspaces:
- name: git-source - name: git-source
- name: docker-credentials - name: docker-credentials
@ -298,4 +267,4 @@ spec:
- name: path-to-image-context - name: path-to-image-context
value: docker/natter_development/ value: docker/natter_development/
- name: path-to-dockerfile - name: path-to-dockerfile
value: docker/natter_development/ value: docker/natter_development/Dockerfile

View File

@ -1,6 +1,4 @@
ARG ALPINE_VERSION="3.20" FROM rustlang/rust:nightly-alpine3.19 AS builder
FROM rustlang/rust:nightly-alpine$ALPINE_VERSION AS builder
RUN apk add --no-cache musl-dev RUN apk add --no-cache musl-dev
@ -8,8 +6,8 @@ RUN mkdir /root/natter
WORKDIR /root/natter WORKDIR /root/natter
COPY . . COPY . .
# TODO: Add static build, which currently errors due to proc_macro. RUSTFLAGS="-C target-feature=+crt-static" # TODO: Add static build, which currently errors due to proc_macro. RUSTFLAGS="-C target-feature=+crt-static"
RUN --mount=type=tmpfs,target=/tmp --mount=type=cache,target=/usr/local/cargo/registry,sharing=locked CARGO_TARGET_DIR=/target cargo build --profile release-lto RUN CARGO_TARGET_DIR=/target cargo build --profile release-lto
FROM alpine:$ALPINE_VERSION AS runner FROM alpine:3.19 AS runner
COPY --from=builder /target/release-lto/natter /usr/bin/ COPY --from=builder /target/release-lto/natter /usr/bin/

View File

@ -1,13 +1,11 @@
ARG ALPINE_VERSION="3.20" FROM rustlang/rust:nightly-alpine3.19 AS builder
FROM rustlang/rust:nightly-alpine$ALPINE_VERSION AS builder
RUN apk add --no-cache musl-dev RUN apk add --no-cache musl-dev
RUN --mount=type=tmpfs,target=/tmp --mount=type=cache,target=/usr/local/cargo/registry,sharing=locked cargo install --locked --no-default-features --features ci-autoclean cargo-cache RUN cargo install --locked --no-default-features --features ci-autoclean cargo-cache
RUN rustup component add rustfmt RUN rustup component add rustfmt
RUN rustup component add clippy RUN rustup component add clippy
FROM builder AS javascript FROM builder AS javascript
RUN apk add --no-cache npm RUN apk add --no-cache npm
RUN --mount=type=tmpfs,target=/tmp --mount=type=cache,target=/npmcache,sharing=locked npm set cache /npmcache && npm install --global prettier@3.1.0 RUN npm install --global prettier@3.1.0