13 Commits

Author SHA1 Message Date
Tom Alexander
d1a8a989f7 maybe 2026-06-19 20:11:31 -04:00
Tom Alexander
97d5adca56 Still fixing. 2026-06-19 18:20:17 -04:00
Tom Alexander
f4046db402 Fix tekton pipelines. 2026-06-19 18:00:44 -04:00
Tom Alexander
27342b0a44 Merge branch 'nix' 2026-06-18 23:49:09 -04:00
Tom Alexander
76ecd25002 Add support for building organic via nix. 2026-06-18 23:16:57 -04:00
Tom Alexander
482d5ecfa3 Switch to local-path-provisioner.
Some checks failed
format Build format has succeeded
clippy Build clippy has failed
rust-test Build rust-test has succeeded
foreign-document-test Build foreign-document-test has succeeded
2025-08-31 19:51:03 -04:00
Tom Alexander
84b8ddb582 Merge branch 'add_jump_to_line_number' 2025-02-01 21:55:43 -05:00
Tom Alexander
113bb5888a Add a test with a tramp link.
Some checks failed
rust-test Build rust-test has started
format Build format has succeeded
clippy Build clippy has failed
2025-02-01 19:19:05 -05:00
Tom Alexander
bf5fe6920b Add a test for jump to line number.
Some checks failed
format Build format has succeeded
clippy Build clippy has failed
rust-test Build rust-test has failed
2025-02-01 18:42:10 -05:00
Tom Alexander
4b52ed0d2a Fix clippy lint.
Some checks failed
format Build format has succeeded
clippy Build clippy has failed
foreign-document-test Build foreign-document-test has succeeded
rust-test Build rust-test has succeeded
2024-10-21 00:25:45 -04:00
Tom Alexander
d2c558ccfa Merge branch 'buildkit'
Some checks failed
format Build format has succeeded
clippy Build clippy has failed
rust-test Build rust-test has succeeded
foreign-document-test Build foreign-document-test has succeeded
2024-10-21 00:13:02 -04:00
Tom Alexander
a01f78b510 Update dockerfiles to take advantage of BuildKit.
Some checks failed
format Build format has succeeded
clippy Build clippy has failed
rust-test Build rust-test has succeeded
2024-10-20 23:13:07 -04:00
Tom Alexander
d80b473fae Switch to using BuiltKit instead of Kaniko to build docker images. 2024-10-20 22:55:22 -04:00
17 changed files with 2021 additions and 133 deletions

2
.gitignore vendored
View File

@@ -1,3 +1,3 @@
/target /target
Cargo.lock
TODO.org TODO.org
/result

View File

@@ -69,42 +69,74 @@ 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/mirror/catalog.git # mirror of https://github.com/tektoncd/catalog.git value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git
- name: revision - name: revision
value: df36b3853a5657fd883015cdbf07ad6466918acf value: 7ee31a185243ee6da13dcd26a592c585b64c80e5
- name: pathInRepo - name: pathInRepo
value: task/kaniko/0.6/kaniko.yaml value: task/buildkit-rootless-daemonless/0.1/buildkit-rootless-daemonless.yaml
params: params:
- name: IMAGE - name: OUTPUT
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)" value: >-
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.12.1"
- name: EXTRA_ARGS - name: EXTRA_ARGS
value: value:
- "--destination=$(params.image-name)" # Also write the :latest image - "--opt"
- "--target=$(params.target-name)" - "target=$(params.target-name)"
- --cache=true - --import-cache
- --cache-copy-layers - "type=registry,ref=$(params.image-name):buildcache"
- --cache-repo=harbor.fizz.buzz/kanikocache/cache - --export-cache
- --use-new-run # Should result in a speed-up - "type=registry,ref=$(params.image-name):buildcache,mode=max,compression=zstd,compression-level=22,rewrite-timestamp=true,image-manifest=true,oci-mediatypes=true"
- --reproducible # To remove timestamps so layer caching works. - --opt
- --snapshot-mode=redo - build-arg:SOURCE_DATE_EPOCH=$(tasks.get-git-commit-time.results.unix-time)
- --skip-unused-stages=true - name: BUILDKITD_TOML
- --registry-mirror=dockerhub.dockerhub.svc.cluster.local value: |
debug = true
[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-image-none - name: run-image-none
taskSpec: taskSpec:
@@ -147,7 +179,7 @@ spec:
- build-image - build-image
params: params:
- name: docker-image - name: docker-image
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)" value: "$(tasks.build-image.results.IMAGE_URL[1])"
############# #############
- name: run-image-tracing - name: run-image-tracing
taskSpec: taskSpec:
@@ -190,7 +222,7 @@ spec:
- run-image-none - run-image-none
params: params:
- name: docker-image - name: docker-image
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)" value: "$(tasks.build-image.results.IMAGE_URL[1])"
############# #############
- name: run-image-compare - name: run-image-compare
taskSpec: taskSpec:
@@ -233,7 +265,7 @@ spec:
- run-image-tracing - run-image-tracing
params: params:
- name: docker-image - name: docker-image
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)" value: "$(tasks.build-image.results.IMAGE_URL[1])"
############# #############
- name: run-image-default - name: run-image-default
taskSpec: taskSpec:
@@ -276,7 +308,7 @@ spec:
- run-image-compare - run-image-compare
params: params:
- name: docker-image - name: docker-image
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)" value: "$(tasks.build-image.results.IMAGE_URL[1])"
############# #############
- name: run-image-tracing-compare - name: run-image-tracing-compare
taskSpec: taskSpec:
@@ -319,7 +351,7 @@ spec:
- run-image-default - run-image-default
params: params:
- name: docker-image - name: docker-image
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)" value: "$(tasks.build-image.results.IMAGE_URL[1])"
############# #############
- name: run-image-compare-foreign - name: run-image-compare-foreign
taskSpec: taskSpec:
@@ -367,7 +399,7 @@ spec:
- run-image-tracing-compare - run-image-tracing-compare
params: params:
- name: docker-image - name: docker-image
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)" value: "$(tasks.build-image.results.IMAGE_URL[1])"
############# #############
- name: run-image-all - name: run-image-all
taskSpec: taskSpec:
@@ -415,7 +447,7 @@ spec:
- run-image-compare-foreign - run-image-compare-foreign
params: params:
- name: docker-image - name: docker-image
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)" value: "$(tasks.build-image.results.IMAGE_URL[1])"
############# #############
- name: run-image-wasm - name: run-image-wasm
taskSpec: taskSpec:
@@ -469,7 +501,7 @@ spec:
- run-image-all - run-image-all
params: params:
- name: docker-image - name: docker-image
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)" value: "$(tasks.build-image.results.IMAGE_URL[1])"
############# #############
- name: run-image-wasm-test - name: run-image-wasm-test
taskSpec: taskSpec:
@@ -519,7 +551,7 @@ spec:
- run-image-wasm - run-image-wasm
params: params:
- name: docker-image - name: docker-image
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)" value: "$(tasks.build-image.results.IMAGE_URL[1])"
############# #############
finally: finally:
- name: report-success - name: report-success
@@ -621,7 +653,7 @@ spec:
subPath: $(params.cache-subdir) subPath: $(params.cache-subdir)
params: params:
- name: docker-image - name: docker-image
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)" value: "$(tasks.build-image.results.IMAGE_URL[1])"
- name: cache-subdir - name: cache-subdir
value: none value: none
# matrix: # matrix:
@@ -645,7 +677,7 @@ spec:
- name: git-source - name: git-source
volumeClaimTemplate: volumeClaimTemplate:
spec: spec:
storageClassName: "nfs-client" storageClassName: "local-path"
accessModes: accessModes:
- ReadWriteOnce - ReadWriteOnce
resources: resources:
@@ -666,4 +698,4 @@ spec:
- name: path-to-image-context - name: path-to-image-context
value: . value: .
- name: path-to-dockerfile - name: path-to-dockerfile
value: docker/organic_development/Dockerfile value: docker/organic_development/

View File

@@ -69,41 +69,74 @@ 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/mirror/catalog.git # mirror of https://github.com/tektoncd/catalog.git value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git
- name: revision - name: revision
value: df36b3853a5657fd883015cdbf07ad6466918acf value: 7ee31a185243ee6da13dcd26a592c585b64c80e5
- name: pathInRepo - name: pathInRepo
value: task/kaniko/0.6/kaniko.yaml value: task/buildkit-rootless-daemonless/0.1/buildkit-rootless-daemonless.yaml
params: params:
- name: IMAGE - name: OUTPUT
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)" value: >-
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.12.1"
- name: EXTRA_ARGS - name: EXTRA_ARGS
value: value:
- "--target=$(params.target-name)" - "--opt"
- --cache=true - "target=$(params.target-name)"
- --cache-copy-layers - --import-cache
- --cache-repo=harbor.fizz.buzz/kanikocache/cache - "type=registry,ref=$(params.image-name):buildcache"
- --use-new-run # Should result in a speed-up - --export-cache
- --reproducible # To remove timestamps so layer caching works. - "type=registry,ref=$(params.image-name):buildcache,mode=max,compression=zstd,compression-level=22,rewrite-timestamp=true,image-manifest=true,oci-mediatypes=true"
- --snapshot-mode=redo - --opt
- --skip-unused-stages=true - build-arg:SOURCE_DATE_EPOCH=$(tasks.get-git-commit-time.results.unix-time)
- --registry-mirror=dockerhub.dockerhub.svc.cluster.local - name: BUILDKITD_TOML
value: |
debug = true
[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-test - name: run-test
taskSpec: taskSpec:
metadata: {} metadata: {}
@@ -141,7 +174,7 @@ spec:
- build-image - build-image
params: params:
- name: docker-image - name: docker-image
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)" value: "$(tasks.build-image.results.IMAGE_URL[1])"
finally: finally:
- name: report-success - name: report-success
when: when:
@@ -235,7 +268,7 @@ spec:
workspace: cargo-cache workspace: cargo-cache
params: params:
- name: docker-image - name: docker-image
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)" value: "$(tasks.build-image.results.IMAGE_URL[1])"
workspaces: workspaces:
- name: git-source - name: git-source
- name: docker-credentials - name: docker-credentials
@@ -244,7 +277,7 @@ spec:
- name: git-source - name: git-source
volumeClaimTemplate: volumeClaimTemplate:
spec: spec:
storageClassName: "nfs-client" storageClassName: "local-path"
accessModes: accessModes:
- ReadWriteOnce - ReadWriteOnce
resources: resources:
@@ -265,4 +298,4 @@ spec:
- name: path-to-image-context - name: path-to-image-context
value: docker/organic_test/ value: docker/organic_test/
- name: path-to-dockerfile - name: path-to-dockerfile
value: docker/organic_test/Dockerfile value: docker/organic_test/

View File

@@ -7,6 +7,7 @@ spec:
pipeline: "2h0m0s" pipeline: "2h0m0s"
tasks: "1h0m0s" tasks: "1h0m0s"
finally: "0h30m0s" finally: "0h30m0s"
# serviceAccountName: build-bot
taskRunTemplate: taskRunTemplate:
serviceAccountName: build-bot serviceAccountName: build-bot
pipelineSpec: pipelineSpec:
@@ -54,14 +55,18 @@ spec:
resolver: git resolver: git
params: params:
- name: url - name: url
value: https://code.fizz.buzz/mirror/catalog.git # mirror of https://github.com/tektoncd/catalog.git value: https://code.fizz.buzz/mirror/git-clone.git # mirror of https://github.com/tektoncd-catalog/git-clone.git
# - name: revision
# value: c3498c69cf6de9583e1c667e723fd8626af1b33c
- name: revision - name: revision
value: df36b3853a5657fd883015cdbf07ad6466918acf value: "v1.7.0"
- name: pathInRepo - name: pathInRepo
value: task/git-clone/0.9/git-clone.yaml value: task/git-clone/git-clone.yaml
workspaces: workspaces:
- name: output - name: output
workspace: git-source workspace: git-source
- name: ssh-directory
workspace: ssh-credentials
params: params:
- name: url - name: url
value: $(params.REPO_URL) value: $(params.REPO_URL)
@@ -69,41 +74,74 @@ 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/mirror/catalog.git # mirror of https://github.com/tektoncd/catalog.git value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git
- name: revision - name: revision
value: df36b3853a5657fd883015cdbf07ad6466918acf value: 7ee31a185243ee6da13dcd26a592c585b64c80e5
- name: pathInRepo - name: pathInRepo
value: task/kaniko/0.6/kaniko.yaml value: task/buildkit-rootless-daemonless/0.1/buildkit-rootless-daemonless.yaml
params: params:
- name: IMAGE - name: OUTPUT
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)" value: >-
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.12.1"
- name: EXTRA_ARGS - name: EXTRA_ARGS
value: value:
- "--target=$(params.target-name)" - "--opt"
- --cache=true - "target=$(params.target-name)"
- --cache-copy-layers - --import-cache
- --cache-repo=harbor.fizz.buzz/kanikocache/cache - "type=registry,ref=$(params.image-name):buildcache"
- --use-new-run # Should result in a speed-up - --export-cache
- --reproducible # To remove timestamps so layer caching works. - "type=registry,ref=$(params.image-name):buildcache,mode=max,compression=zstd,compression-level=22,rewrite-timestamp=true,image-manifest=true,oci-mediatypes=true"
- --snapshot-mode=redo - --opt
- --skip-unused-stages=true - build-arg:SOURCE_DATE_EPOCH=$(tasks.get-git-commit-time.results.unix-time)
- --registry-mirror=dockerhub.dockerhub.svc.cluster.local - name: BUILDKITD_TOML
value: |
debug = true
[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: {}
@@ -143,7 +181,7 @@ spec:
- build-image - build-image
params: params:
- name: docker-image - name: docker-image
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)" value: "$(tasks.build-image.results.IMAGE_URL[1])"
- name: commit-changes - name: commit-changes
taskRef: taskRef:
resolver: git resolver: git
@@ -268,16 +306,17 @@ spec:
workspace: cargo-cache workspace: cargo-cache
params: params:
- name: docker-image - name: docker-image
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)" value: "$(tasks.build-image.results.IMAGE_URL[1])"
workspaces: workspaces:
- name: git-source - name: git-source
- name: docker-credentials - name: docker-credentials
- name: cargo-cache - name: cargo-cache
- name: ssh-credentials
workspaces: workspaces:
- name: git-source - name: git-source
volumeClaimTemplate: volumeClaimTemplate:
spec: spec:
storageClassName: "nfs-client" storageClassName: "local-path"
accessModes: accessModes:
- ReadWriteOnce - ReadWriteOnce
resources: resources:
@@ -290,6 +329,9 @@ spec:
- name: docker-credentials - name: docker-credentials
secret: secret:
secretName: harbor-plain secretName: harbor-plain
- name: ssh-credentials
secret:
secretName: git-credentials
params: params:
- name: image-name - name: image-name
value: "harbor.fizz.buzz/private/organic-development-format" value: "harbor.fizz.buzz/private/organic-development-format"
@@ -298,4 +340,4 @@ spec:
- name: path-to-image-context - name: path-to-image-context
value: docker/organic_development/ value: docker/organic_development/
- name: path-to-dockerfile - name: path-to-dockerfile
value: docker/organic_development/Dockerfile value: docker/organic_development/

View File

@@ -69,41 +69,74 @@ 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/mirror/catalog.git # mirror of https://github.com/tektoncd/catalog.git value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git
- name: revision - name: revision
value: df36b3853a5657fd883015cdbf07ad6466918acf value: 7ee31a185243ee6da13dcd26a592c585b64c80e5
- name: pathInRepo - name: pathInRepo
value: task/kaniko/0.6/kaniko.yaml value: task/buildkit-rootless-daemonless/0.1/buildkit-rootless-daemonless.yaml
params: params:
- name: IMAGE - name: OUTPUT
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)" value: >-
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.12.1"
- name: EXTRA_ARGS - name: EXTRA_ARGS
value: value:
- "--target=$(params.target-name)" - "--opt"
- --cache=true - "target=$(params.target-name)"
- --cache-copy-layers - --import-cache
- --cache-repo=harbor.fizz.buzz/kanikocache/cache - "type=registry,ref=$(params.image-name):buildcache"
- --use-new-run # Should result in a speed-up - --export-cache
- --reproducible # To remove timestamps so layer caching works. - "type=registry,ref=$(params.image-name):buildcache,mode=max,compression=zstd,compression-level=22,rewrite-timestamp=true,image-manifest=true,oci-mediatypes=true"
- --snapshot-mode=redo - --opt
- --skip-unused-stages=true - build-arg:SOURCE_DATE_EPOCH=$(tasks.get-git-commit-time.results.unix-time)
- --registry-mirror=dockerhub.dockerhub.svc.cluster.local - name: BUILDKITD_TOML
value: |
debug = true
[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: {}
@@ -153,7 +186,7 @@ spec:
- build-image - build-image
params: params:
- name: docker-image - name: docker-image
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)" value: "$(tasks.build-image.results.IMAGE_URL[1])"
finally: finally:
- name: report-success - name: report-success
when: when:
@@ -247,7 +280,7 @@ spec:
workspace: cargo-cache workspace: cargo-cache
params: params:
- name: docker-image - name: docker-image
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)" value: "$(tasks.build-image.results.IMAGE_URL[1])"
workspaces: workspaces:
- name: git-source - name: git-source
- name: docker-credentials - name: docker-credentials
@@ -256,7 +289,7 @@ spec:
- name: git-source - name: git-source
volumeClaimTemplate: volumeClaimTemplate:
spec: spec:
storageClassName: "nfs-client" storageClassName: "local-path"
accessModes: accessModes:
- ReadWriteOnce - ReadWriteOnce
resources: resources:
@@ -277,4 +310,4 @@ spec:
- name: path-to-image-context - name: path-to-image-context
value: docker/organic_development/ value: docker/organic_development/
- name: path-to-dockerfile - name: path-to-dockerfile
value: docker/organic_development/Dockerfile value: docker/organic_development/

View File

@@ -69,41 +69,74 @@ 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/mirror/catalog.git # mirror of https://github.com/tektoncd/catalog.git value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git
- name: revision - name: revision
value: df36b3853a5657fd883015cdbf07ad6466918acf value: 7ee31a185243ee6da13dcd26a592c585b64c80e5
- name: pathInRepo - name: pathInRepo
value: task/kaniko/0.6/kaniko.yaml value: task/buildkit-rootless-daemonless/0.1/buildkit-rootless-daemonless.yaml
params: params:
- name: IMAGE - name: OUTPUT
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)" value: >-
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.12.1"
- name: EXTRA_ARGS - name: EXTRA_ARGS
value: value:
- "--target=$(params.target-name)" - "--opt"
- --cache=true - "target=$(params.target-name)"
- --cache-copy-layers - --import-cache
- --cache-repo=harbor.fizz.buzz/kanikocache/cache - "type=registry,ref=$(params.image-name):buildcache"
- --use-new-run # Should result in a speed-up - --export-cache
- --reproducible # To remove timestamps so layer caching works. - "type=registry,ref=$(params.image-name):buildcache,mode=max,compression=zstd,compression-level=22,rewrite-timestamp=true,image-manifest=true,oci-mediatypes=true"
- --snapshot-mode=redo - --opt
- --skip-unused-stages=true - build-arg:SOURCE_DATE_EPOCH=$(tasks.get-git-commit-time.results.unix-time)
- --registry-mirror=dockerhub.dockerhub.svc.cluster.local - name: BUILDKITD_TOML
value: |
debug = true
[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: {}
@@ -152,7 +185,7 @@ spec:
- build-image - build-image
params: params:
- name: docker-image - name: docker-image
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)" value: "$(tasks.build-image.results.IMAGE_URL[1])"
finally: finally:
- name: report-success - name: report-success
when: when:
@@ -246,7 +279,7 @@ spec:
workspace: cargo-cache workspace: cargo-cache
params: params:
- name: docker-image - name: docker-image
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)" value: "$(tasks.build-image.results.IMAGE_URL[1])"
workspaces: workspaces:
- name: git-source - name: git-source
- name: docker-credentials - name: docker-credentials
@@ -255,7 +288,7 @@ spec:
- name: git-source - name: git-source
volumeClaimTemplate: volumeClaimTemplate:
spec: spec:
storageClassName: "nfs-client" storageClassName: "local-path"
accessModes: accessModes:
- ReadWriteOnce - ReadWriteOnce
resources: resources:
@@ -276,4 +309,4 @@ spec:
- name: path-to-image-context - name: path-to-image-context
value: docker/organic_test/ value: docker/organic_test/
- name: path-to-dockerfile - name: path-to-dockerfile
value: docker/organic_test/Dockerfile value: docker/organic_test/

1446
Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,4 @@
# cargo-features = ["profile-rustflags"] # cargo-features = ["profile-rustflags"]
cargo-features = ["codegen-backend"]
[package] [package]
name = "organic" name = "organic"
@@ -104,9 +103,5 @@ inherits = "release"
lto = true lto = true
strip = true strip = true
[profile.dev]
codegen-backend = "cranelift"
[profile.dev.package."*"] [profile.dev.package."*"]
codegen-backend = "llvm"
opt-level = 3 opt-level = 3

View File

@@ -26,7 +26,7 @@ fn main() {
dir_entry.file_type().is_file() dir_entry.file_type().is_file()
&& Path::new(dir_entry.file_name()) && Path::new(dir_entry.file_name())
.extension() .extension()
.map(|ext| ext.to_ascii_lowercase() == "org") .map(|ext| ext.eq_ignore_ascii_case("org"))
.unwrap_or(false) .unwrap_or(false)
} }
Err(_) => true, Err(_) => true,

View File

@@ -1,7 +1,10 @@
FROM rustlang/rust:nightly-alpine3.20 AS builder # syntax=docker/dockerfile:1
ARG ALPINE_VERSION="3.20"
FROM rustlang/rust:nightly-alpine$ALPINE_VERSION AS builder
RUN apk add --no-cache musl-dev RUN apk add --no-cache musl-dev
RUN cargo install --locked --no-default-features --features ci-autoclean cargo-cache 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 rustup component add rustc-codegen-cranelift RUN rustup component add rustc-codegen-cranelift
FROM builder AS format FROM builder AS format

View File

@@ -1,3 +1,6 @@
# syntax=docker/dockerfile:1
ARG ALPINE_VERSION="3.20"
# ARG EMACS_REPO=https://git.savannah.gnu.org/git/emacs.git # ARG EMACS_REPO=https://git.savannah.gnu.org/git/emacs.git
ARG EMACS_REPO=https://code.fizz.buzz/mirror/emacs.git ARG EMACS_REPO=https://code.fizz.buzz/mirror/emacs.git
@@ -9,7 +12,7 @@ ARG ORG_MODE_REPO=https://code.fizz.buzz/mirror/org-mode.git
ARG ORG_VERSION=abf5156096c06ee5aa05795c3dc5a065f76ada97 ARG ORG_VERSION=abf5156096c06ee5aa05795c3dc5a065f76ada97
FROM alpine:3.20 AS build FROM alpine:$ALPINE_VERSION AS build
RUN apk add --no-cache build-base musl-dev git autoconf make texinfo gnutls-dev ncurses-dev gawk libgccjit-dev RUN apk add --no-cache build-base musl-dev git autoconf make texinfo gnutls-dev ncurses-dev gawk libgccjit-dev
@@ -28,7 +31,7 @@ RUN make DESTDIR="/root/dist" install
FROM build AS build-org-mode FROM build AS build-org-mode
ARG ORG_VERSION ARG ORG_VERSION
ARG ORG_MODE_REPO ARG ORG_MODE_REPO
COPY --from=build-emacs /root/dist/ / COPY --link --from=build-emacs /root/dist/ /
RUN mkdir /root/dist RUN mkdir /root/dist
# Savannah does not allow fetching specific revisions, so we're going to have to put unnecessary load on their server by cloning main and then checking out the revision we want. # Savannah does not allow fetching specific revisions, so we're going to have to put unnecessary load on their server by cloning main and then checking out the revision we want.
RUN git clone $ORG_MODE_REPO /root/org-mode && git -C /root/org-mode checkout $ORG_VERSION RUN git clone $ORG_MODE_REPO /root/org-mode && git -C /root/org-mode checkout $ORG_VERSION
@@ -38,13 +41,13 @@ RUN make compile
RUN make DESTDIR="/root/dist" install RUN make DESTDIR="/root/dist" install
FROM rustlang/rust:nightly-alpine3.20 AS tester FROM rustlang/rust:nightly-alpine$ALPINE_VERSION AS tester
ENV LANG=en_US.UTF-8 ENV LANG=en_US.UTF-8
RUN apk add --no-cache musl-dev ncurses gnutls libgccjit RUN apk add --no-cache musl-dev ncurses gnutls libgccjit
RUN cargo install --locked --no-default-features --features ci-autoclean cargo-cache 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 rustup component add rustc-codegen-cranelift RUN rustup component add rustc-codegen-cranelift
COPY --from=build-emacs /root/dist/ / COPY --link --from=build-emacs /root/dist/ /
COPY --from=build-org-mode /root/dist/ / COPY --link --from=build-org-mode /root/dist/ /
ENTRYPOINT ["cargo", "test"] ENTRYPOINT ["cargo", "test"]
@@ -117,10 +120,10 @@ RUN rm $LITERATE_BUILD_EMACS_PATH/unused/aws.org
FROM tester as foreign-document FROM tester as foreign-document
RUN apk add --no-cache bash coreutils RUN apk add --no-cache bash coreutils
RUN mkdir /foreign_documents RUN mkdir /foreign_documents
COPY --from=foreign-document-gather /foreign_documents/howardabrams /foreign_documents/howardabrams COPY --link --from=foreign-document-gather /foreign_documents/howardabrams /foreign_documents/howardabrams
COPY --from=foreign-document-gather /foreign_documents/doomemacs /foreign_documents/doomemacs COPY --link --from=foreign-document-gather /foreign_documents/doomemacs /foreign_documents/doomemacs
COPY --from=foreign-document-gather /foreign_documents/worg /foreign_documents/worg COPY --link --from=foreign-document-gather /foreign_documents/worg /foreign_documents/worg
COPY --from=foreign-document-gather /foreign_documents/literate_build_emacs /foreign_documents/literate_build_emacs COPY --link --from=foreign-document-gather /foreign_documents/literate_build_emacs /foreign_documents/literate_build_emacs
COPY --from=build-org-mode /root/org-mode /foreign_documents/org-mode COPY --link --from=build-org-mode /root/org-mode /foreign_documents/org-mode
COPY --from=build-emacs /root/emacs /foreign_documents/emacs COPY --link --from=build-emacs /root/emacs /foreign_documents/emacs
ENTRYPOINT ["cargo", "run", "--bin", "foreign_document_test", "--features", "compare,foreign_document_test", "--profile", "release-lto"] ENTRYPOINT ["cargo", "run", "--bin", "foreign_document_test", "--features", "compare,foreign_document_test", "--profile", "release-lto"]

48
flake.lock generated Normal file
View File

@@ -0,0 +1,48 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1780749050,
"narHash": "sha256-3av0pIjlOWQ6rDbNOmpUSvbNnJkGORQKKjb4LtCZsIY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a799d3e3886da994fa307f817a6bc705ae538eeb",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
}
},
"rust-overlay": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1781407245,
"narHash": "sha256-VzJq4MmD0uyNDAceudSe1hHqcQMe9Tau0U4S+5iRGh0=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "d5f483210eb016d66102eef22baa128b3b3233fc",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

139
flake.nix Normal file
View File

@@ -0,0 +1,139 @@
{
description = "Organic Org parser";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
};
outputs =
{
self,
nixpkgs,
rust-overlay,
}:
let
forAllSystems =
func:
builtins.listToAttrs (
map (system: {
name = system;
value = func system;
}) nixpkgs.lib.systems.flakeExposed
);
in
{
devShells = forAllSystems (
system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
rustToolchain =
(pkgs.pkgsBuildHost.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml).override
{ targets = [ "wasm32-unknown-unknown" ]; };
in
{
default = pkgs.mkShell {
nativeBuildInputs = [
rustToolchain
];
buildInputs = with pkgs; [
wasm-bindgen-cli
];
};
}
);
packages = forAllSystems (
system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
build_wasm =
{
bindgenTarget ? null,
}:
(pkgs.callPackage ./nix/package.nix {
targetBins = [
"wasm"
];
features = [ "wasm" ];
cargoBuildTarget = "wasm32-unknown-unknown";
buildType = "wasm";
}).overrideAttrs
(
old:
let
bindgen_command = [
"${pkgs.wasm-bindgen-cli}/bin/wasm-bindgen"
"--target"
bindgenTarget
"--out-dir"
"target/wasm32-unknown-unknown/${bindgenTarget}"
"target/wasm32-unknown-unknown/wasm/wasm.wasm"
];
in
{
postBuild = ''
${pkgs.lib.escapeShellArgs bindgen_command}
'';
installPhase = ''
mkdir -p $out/share/${bindgenTarget}
cp target/wasm32-unknown-unknown/${bindgenTarget}/* $out/share/${bindgenTarget}
'';
}
);
in
rec {
all = pkgs.symlinkJoin {
name = "all";
paths = [
library
devTools
wasm_bundler
wasm_web
];
};
library = (pkgs.callPackage ./nix/package.nix { buildLib = true; }).overrideAttrs (
old:
let
in
{
installPhase = ''
mkdir -p $out/lib
cp target/*/release/liborganic.rlib $out/lib/
'';
}
);
devTools = pkgs.callPackage ./nix/package.nix {
targetBins = [
"parse"
"compare"
];
features = [ "compare" ];
};
wasm_bundler = build_wasm { bindgenTarget = "bundler"; };
wasm_web = build_wasm { bindgenTarget = "web"; };
docker_env = pkgs.buildEnv {
name = "organic";
paths = with pkgs; [
devTools
bash
uutils-coreutils-noprefix
# toybox # Smaller than uutils-coreutils?
];
};
default = all;
}
);
};
}

75
nix/package.nix Normal file
View File

@@ -0,0 +1,75 @@
{
hello,
lib,
makeRustPlatform,
pkgsBuildHost,
targetBins ? [ ],
features ? [ ],
cargoBuildTarget ? null,
buildType ? null,
buildLib ? false,
}:
let
cargoToml = (lib.importTOML ../Cargo.toml);
rustToolchain = (pkgsBuildHost.rust-bin.fromRustupToolchainFile ../rust-toolchain.toml).override (
if cargoBuildTarget != null then
{
targets = [ cargoBuildTarget ];
}
else
{ }
);
baseRustPlatform = (
makeRustPlatform {
cargo = rustToolchain;
rustc = rustToolchain;
}
);
rustPlatform =
if cargoBuildTarget != null then
baseRustPlatform.overrideScope (
final: prev: {
cargoBuildHook = prev.cargoBuildHook.overrideDerivation (_: {
rustcTargetSpec = cargoBuildTarget;
});
cargoInstallHook = hello;
}
)
else
baseRustPlatform;
in
rustPlatform.buildRustPackage (
{
pname = "organic";
version = cargoToml.package.version;
src = lib.cleanSource ../.;
cargoLock.lockFile = ../Cargo.lock;
cargoBuildFlags = builtins.concatLists [
(builtins.concatMap (targetBin: [
"--bin"
targetBin
]) targetBins)
(if buildLib then [ "--lib" ] else [ ])
(
if features != [ ] then
[
"--features"
(builtins.concatStringsSep " " features)
]
else
[ ]
)
];
}
// (
if buildType != null then
{
buildType = buildType;
}
else
{ }
)
)

View File

@@ -0,0 +1 @@
[[file:simple.org::2]]

View File

@@ -0,0 +1 @@
[[/ssh:admin@test.example:important/file.pdf]]

4
rust-toolchain.toml Normal file
View File

@@ -0,0 +1,4 @@
[toolchain]
channel = "nightly"
profile = "default"
components = ["clippy", "rustfmt"]