Skip to content

Commit

Permalink
feat: global buildkit service (#357)
Browse files Browse the repository at this point in the history
  • Loading branch information
devthejo authored Jul 18, 2023
1 parent df9c977 commit ebafbd6
Show file tree
Hide file tree
Showing 12 changed files with 173 additions and 375 deletions.
48 changes: 14 additions & 34 deletions packages/kontinuous/tests/__snapshots__/job-builds.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,24 +186,14 @@ spec:
buildctl_options_mtls=\\"\\"
if [ \\"\\" != \\"\\" ]; then
buildctl_cmd=\\"buildctl \\\\
--addr tcp://buildkit-service.buildkit-service.svc:1234 \\\\
\\"
if [ -f /buildkit-certs/cert.pem ]; then
buildctl_options_mtls=\\"\\\\
--tlscacert /buildkit-certs/ca.pem \\\\
--tlscert /buildkit-certs/cert.pem \\\\
--tlskey /buildkit-certs/key.pem \\\\
\\"
fi
else
buildctl_cmd=buildctl-daemonless.sh
buildctl_options_cache=\\"\\\\
--export-cache type=inline \\\\
--import-cache type=registry,ref=$IMAGE_PATH:feature-branch-1 \\\\
buildctl_cmd=buildctl-daemonless.sh
buildctl_options_cache=\\"\\\\
--export-cache type=inline \\\\
--import-cache type=registry,ref=$IMAGE_PATH:feature-branch-1 \\\\
\\"
fi
mkdir -p /home/user/.docker
Expand Down Expand Up @@ -376,24 +366,14 @@ spec:
buildctl_options_mtls=\\"\\"
if [ \\"\\" != \\"\\" ]; then
buildctl_cmd=\\"buildctl \\\\
--addr tcp://buildkit-service.buildkit-service.svc:1234 \\\\
\\"
if [ -f /buildkit-certs/cert.pem ]; then
buildctl_options_mtls=\\"\\\\
--tlscacert /buildkit-certs/ca.pem \\\\
--tlscert /buildkit-certs/cert.pem \\\\
--tlskey /buildkit-certs/key.pem \\\\
\\"
fi
else
buildctl_cmd=buildctl-daemonless.sh
buildctl_options_cache=\\"\\\\
--export-cache type=inline \\\\
--import-cache type=registry,ref=$IMAGE_PATH:feature-branch-1 \\\\
buildctl_cmd=buildctl-daemonless.sh
buildctl_options_cache=\\"\\\\
--export-cache type=inline \\\\
--import-cache type=registry,ref=$IMAGE_PATH:feature-branch-1 \\\\
\\"
fi
mkdir -p /home/user/.docker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,24 +187,14 @@ spec:
buildctl_options_mtls=\\"\\"
if [ \\"\\" != \\"\\" ]; then
buildctl_cmd=\\"buildctl \\\\
--addr tcp://buildkit-service.buildkit-service.svc:1234 \\\\
\\"
if [ -f /buildkit-certs/cert.pem ]; then
buildctl_options_mtls=\\"\\\\
--tlscacert /buildkit-certs/ca.pem \\\\
--tlscert /buildkit-certs/cert.pem \\\\
--tlskey /buildkit-certs/key.pem \\\\
\\"
fi
else
buildctl_cmd=buildctl-daemonless.sh
buildctl_options_cache=\\"\\\\
--export-cache type=inline \\\\
--import-cache type=registry,ref=$IMAGE_PATH:feature-branch-1 \\\\
buildctl_cmd=buildctl-daemonless.sh
buildctl_options_cache=\\"\\\\
--export-cache type=inline \\\\
--import-cache type=registry,ref=$IMAGE_PATH:feature-branch-1 \\\\
\\"
fi
mkdir -p /home/user/.docker
Expand Down
48 changes: 14 additions & 34 deletions packages/kontinuous/tests/__snapshots__/jobs-build-stage.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -483,24 +483,14 @@ spec:
buildctl_options_mtls=\\"\\"
if [ \\"\\" != \\"\\" ]; then
buildctl_cmd=\\"buildctl \\\\
--addr tcp://buildkit-service.buildkit-service.svc:1234 \\\\
\\"
if [ -f /buildkit-certs/cert.pem ]; then
buildctl_options_mtls=\\"\\\\
--tlscacert /buildkit-certs/ca.pem \\\\
--tlscert /buildkit-certs/cert.pem \\\\
--tlskey /buildkit-certs/key.pem \\\\
\\"
fi
else
buildctl_cmd=buildctl-daemonless.sh
buildctl_options_cache=\\"\\\\
--export-cache type=inline \\\\
--import-cache type=registry,ref=$IMAGE_PATH:feature-branch-1 \\\\
buildctl_cmd=buildctl-daemonless.sh
buildctl_options_cache=\\"\\\\
--export-cache type=inline \\\\
--import-cache type=registry,ref=$IMAGE_PATH:feature-branch-1 \\\\
\\"
fi
mkdir -p /home/user/.docker
Expand Down Expand Up @@ -673,24 +663,14 @@ spec:
buildctl_options_mtls=\\"\\"
if [ \\"\\" != \\"\\" ]; then
buildctl_cmd=\\"buildctl \\\\
--addr tcp://buildkit-service.buildkit-service.svc:1234 \\\\
\\"
if [ -f /buildkit-certs/cert.pem ]; then
buildctl_options_mtls=\\"\\\\
--tlscacert /buildkit-certs/ca.pem \\\\
--tlscert /buildkit-certs/cert.pem \\\\
--tlskey /buildkit-certs/key.pem \\\\
\\"
fi
else
buildctl_cmd=buildctl-daemonless.sh
buildctl_options_cache=\\"\\\\
--export-cache type=inline \\\\
--import-cache type=registry,ref=$IMAGE_PATH:feature-branch-1 \\\\
buildctl_cmd=buildctl-daemonless.sh
buildctl_options_cache=\\"\\\\
--export-cache type=inline \\\\
--import-cache type=registry,ref=$IMAGE_PATH:feature-branch-1 \\\\
\\"
fi
mkdir -p /home/user/.docker
Expand Down
48 changes: 14 additions & 34 deletions packages/kontinuous/tests/__snapshots__/jobs-build.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -482,24 +482,14 @@ spec:
buildctl_options_mtls=\\"\\"
if [ \\"\\" != \\"\\" ]; then
buildctl_cmd=\\"buildctl \\\\
--addr tcp://buildkit-service.buildkit-service.svc:1234 \\\\
\\"
if [ -f /buildkit-certs/cert.pem ]; then
buildctl_options_mtls=\\"\\\\
--tlscacert /buildkit-certs/ca.pem \\\\
--tlscert /buildkit-certs/cert.pem \\\\
--tlskey /buildkit-certs/key.pem \\\\
\\"
fi
else
buildctl_cmd=buildctl-daemonless.sh
buildctl_options_cache=\\"\\\\
--export-cache type=inline \\\\
--import-cache type=registry,ref=$IMAGE_PATH:feature-branch-1 \\\\
buildctl_cmd=buildctl-daemonless.sh
buildctl_options_cache=\\"\\\\
--export-cache type=inline \\\\
--import-cache type=registry,ref=$IMAGE_PATH:feature-branch-1 \\\\
\\"
fi
mkdir -p /home/user/.docker
Expand Down Expand Up @@ -671,24 +661,14 @@ spec:
buildctl_options_mtls=\\"\\"
if [ \\"\\" != \\"\\" ]; then
buildctl_cmd=\\"buildctl \\\\
--addr tcp://buildkit-service.buildkit-service.svc:1234 \\\\
\\"
if [ -f /buildkit-certs/cert.pem ]; then
buildctl_options_mtls=\\"\\\\
--tlscacert /buildkit-certs/ca.pem \\\\
--tlscert /buildkit-certs/cert.pem \\\\
--tlskey /buildkit-certs/key.pem \\\\
\\"
fi
else
buildctl_cmd=buildctl-daemonless.sh
buildctl_options_cache=\\"\\\\
--export-cache type=inline \\\\
--import-cache type=registry,ref=$IMAGE_PATH:feature-branch-1 \\\\
buildctl_cmd=buildctl-daemonless.sh
buildctl_options_cache=\\"\\\\
--export-cache type=inline \\\\
--import-cache type=registry,ref=$IMAGE_PATH:feature-branch-1 \\\\
\\"
fi
mkdir -p /home/user/.docker
Expand Down
96 changes: 28 additions & 68 deletions packages/kontinuous/tests/__snapshots__/repo.domifa.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -223,24 +223,14 @@ spec:
buildctl_options_mtls=\\"\\"
if [ \\"\\" != \\"\\" ]; then
buildctl_cmd=\\"buildctl \\\\
--addr tcp://buildkit-service.buildkit-service.svc:1234 \\\\
\\"
if [ -f /buildkit-certs/cert.pem ]; then
buildctl_options_mtls=\\"\\\\
--tlscacert /buildkit-certs/ca.pem \\\\
--tlscert /buildkit-certs/cert.pem \\\\
--tlskey /buildkit-certs/key.pem \\\\
\\"
fi
else
buildctl_cmd=buildctl-daemonless.sh
buildctl_options_cache=\\"\\\\
--export-cache type=inline \\\\
--import-cache type=registry,ref=$IMAGE_PATH:feature-branch-1 \\\\
buildctl_cmd=buildctl-daemonless.sh
buildctl_options_cache=\\"\\\\
--export-cache type=inline \\\\
--import-cache type=registry,ref=$IMAGE_PATH:feature-branch-1 \\\\
\\"
fi
mkdir -p /home/user/.docker
Expand Down Expand Up @@ -417,24 +407,14 @@ spec:
buildctl_options_mtls=\\"\\"
if [ \\"\\" != \\"\\" ]; then
buildctl_cmd=\\"buildctl \\\\
--addr tcp://buildkit-service.buildkit-service.svc:1234 \\\\
\\"
if [ -f /buildkit-certs/cert.pem ]; then
buildctl_options_mtls=\\"\\\\
--tlscacert /buildkit-certs/ca.pem \\\\
--tlscert /buildkit-certs/cert.pem \\\\
--tlskey /buildkit-certs/key.pem \\\\
\\"
fi
else
buildctl_cmd=buildctl-daemonless.sh
buildctl_options_cache=\\"\\\\
--export-cache type=inline \\\\
--import-cache type=registry,ref=$IMAGE_PATH:feature-branch-1 \\\\
buildctl_cmd=buildctl-daemonless.sh
buildctl_options_cache=\\"\\\\
--export-cache type=inline \\\\
--import-cache type=registry,ref=$IMAGE_PATH:feature-branch-1 \\\\
\\"
fi
mkdir -p /home/user/.docker
Expand Down Expand Up @@ -612,24 +592,14 @@ spec:
buildctl_options_mtls=\\"\\"
if [ \\"\\" != \\"\\" ]; then
buildctl_cmd=\\"buildctl \\\\
--addr tcp://buildkit-service.buildkit-service.svc:1234 \\\\
\\"
if [ -f /buildkit-certs/cert.pem ]; then
buildctl_options_mtls=\\"\\\\
--tlscacert /buildkit-certs/ca.pem \\\\
--tlscert /buildkit-certs/cert.pem \\\\
--tlskey /buildkit-certs/key.pem \\\\
\\"
fi
else
buildctl_cmd=buildctl-daemonless.sh
buildctl_options_cache=\\"\\\\
--export-cache type=inline \\\\
--import-cache type=registry,ref=$IMAGE_PATH:feature-branch-1 \\\\
buildctl_cmd=buildctl-daemonless.sh
buildctl_options_cache=\\"\\\\
--export-cache type=inline \\\\
--import-cache type=registry,ref=$IMAGE_PATH:feature-branch-1 \\\\
\\"
fi
mkdir -p /home/user/.docker
Expand Down Expand Up @@ -803,24 +773,14 @@ spec:
buildctl_options_mtls=\\"\\"
if [ \\"\\" != \\"\\" ]; then
buildctl_cmd=\\"buildctl \\\\
--addr tcp://buildkit-service.buildkit-service.svc:1234 \\\\
\\"
if [ -f /buildkit-certs/cert.pem ]; then
buildctl_options_mtls=\\"\\\\
--tlscacert /buildkit-certs/ca.pem \\\\
--tlscert /buildkit-certs/cert.pem \\\\
--tlskey /buildkit-certs/key.pem \\\\
\\"
fi
else
buildctl_cmd=buildctl-daemonless.sh
buildctl_options_cache=\\"\\\\
--export-cache type=inline \\\\
--import-cache type=registry,ref=$IMAGE_PATH:feature-branch-1 \\\\
buildctl_cmd=buildctl-daemonless.sh
buildctl_options_cache=\\"\\\\
--export-cache type=inline \\\\
--import-cache type=registry,ref=$IMAGE_PATH:feature-branch-1 \\\\
\\"
fi
mkdir -p /home/user/.docker
Expand Down
Loading

0 comments on commit ebafbd6

Please sign in to comment.