summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElizabeth Hunt <me@liz.coffee>2025-07-12 16:10:58 -0700
committerElizabeth Hunt <me@liz.coffee>2025-07-13 12:56:22 -0700
commitf7797922027daed86d14c1128e2fa64202fb16dd (patch)
treeff9d0c17b6f404c5ee0e498e595f4c3818571c7d
parent8e588a19944e89ded711a1e150b5cd6e7d341994 (diff)
downloadci-f7797922027daed86d14c1128e2fa64202fb16dd.tar.gz
ci-f7797922027daed86d14c1128e2fa64202fb16dd.zip
Fix pipeline generator path, docker run in child container
-rw-r--r--.ci/ci.json2
-rwxr-xr-xindex.ts2
-rw-r--r--server/job/run_activity.ts1
-rw-r--r--worker/Dockerfile10
-rwxr-xr-xworker/scripts/checkout_ci.ts6
5 files changed, 7 insertions, 14 deletions
diff --git a/.ci/ci.json b/.ci/ci.json
index e10df80..6a51028 100644
--- a/.ci/ci.json
+++ b/.ci/ci.json
@@ -1,3 +1,3 @@
{
- "workflow": ".ci/ci.js"
+ "workflow": ".ci/ci.cjs"
}
diff --git a/index.ts b/index.ts
index 86119ca..714316d 100755
--- a/index.ts
+++ b/index.ts
@@ -28,7 +28,7 @@ const main = (_argv = process.argv.slice(2)): Promise<IEither<Error, void>> =>
if (process.argv[1] === import.meta.filename) {
await main().then((eitherDone) =>
eitherDone.mapLeft((err) => {
- console.error(`failed to start`, err);
+ console.error('error:', err);
process.exit(1);
}),
);
diff --git a/server/job/run_activity.ts b/server/job/run_activity.ts
index 22bc4c7..95b28cc 100644
--- a/server/job/run_activity.ts
+++ b/server/job/run_activity.ts
@@ -9,7 +9,6 @@ import {
LogLevel,
LogMetricTraceSupplier,
Metric,
- MetricsTraceSupplier,
PenguenoError,
type PenguenoRequest,
type ServerTrace,
diff --git a/worker/Dockerfile b/worker/Dockerfile
index 51129b2..396f73b 100644
--- a/worker/Dockerfile
+++ b/worker/Dockerfile
@@ -7,9 +7,6 @@ RUN apt-get update && apt-get install -yqq unzip curl
RUN curl -L -o /bw-linux.zip "https://github.com/bitwarden/clients/releases/download/cli-v${BITWARDEN_VERSION}/bw-linux-${BITWARDEN_VERSION}.zip"
RUN unzip /bw-linux.zip -d / \
&& chmod +x /bw
-
-RUN curl -L "https://get.docker.com/builds/$(uname -s)/$(uname -m)/docker-latest.tgz" > /docker.tgz
-RUN tar -xvzf /docker.tgz
# -- </worker_dependencies> --
# -- <ci_worker> --
@@ -17,23 +14,20 @@ FROM oci.liz.coffee/emprespresso/ci_base:release AS worker
RUN apt-get update && apt-get install -yqq git jq
-RUN chmod +x /app/worker/dist/scripts/*.js
ENV PIPELINE_PATH=/app/worker/dist/scripts
+RUN chmod +x /app/worker/dist/scripts/*
RUN mkdir -p /var/lib/laminar/cfg
RUN cp -r /app/worker/jobs /var/lib/laminar/cfg
RUN chown -R 1000:1000 /var/lib/laminar
-RUN groupadd docker
-
+RUN curl -fsSL https://get.docker.com | sh
# see: https://github.com/nodejs/docker-node/blame/89b29ef06b421598ec007605a2604ede0348b298/22/bullseye-slim/Dockerfile#L3-L4
RUN usermod -a -d /var/lib/laminar -G docker node
# RUN useradd --system --home-dir /var/lib/laminar \
# --no-user-group --groups users,docker --uid 1000 laminar
COPY --from=worker_dependencies /bw /usr/local/bin/
-COPY --from=worker_dependencies /docker/* /usr/local/bin/
-RUN chmod -v a+s /usr/local/bin/docker # give access to run docker binary as sid
USER node
WORKDIR /var/lib/laminar
diff --git a/worker/scripts/checkout_ci.ts b/worker/scripts/checkout_ci.ts
index efc2e0e..d71df6e 100755
--- a/worker/scripts/checkout_ci.ts
+++ b/worker/scripts/checkout_ci.ts
@@ -14,7 +14,7 @@ import {
IEither,
} from '@emprespresso/pengueno';
import { mkdir, readFile, rm } from 'fs/promises';
-import { join } from 'path';
+import { basename, join } from 'path';
import { type CheckoutCiJob, type FetchCodeJob, PipelineImpl } from '@emprespresso/ci_model';
import { executeJob, executePipeline } from '@emprespresso/ci_worker';
@@ -170,9 +170,9 @@ function getPipelineGenerationCommand(
'-e',
),
'-v',
- `${getSrcDirectoryForCiJob(job)}/${pipelineGeneratorPath}:/pipeline_generator`,
+ `${getSrcDirectoryForCiJob(job)}:/src`,
image,
- '/pipeline_generator',
+ `/src/${pipelineGeneratorPath}`,
],
]);
}