Skip to content

Commit 3ea76c1

Browse files
authoredJun 12, 2024
Merge pull request #11 from circleci/ONPREM-1263/task-agent-download
Download task agent binaries directly via the Dockerfile
2 parents b10bfb3 + 18b277c commit 3ea76c1

File tree

6 files changed

+12
-23
lines changed

6 files changed

+12
-23
lines changed
 

‎.circleci/config.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,12 @@ jobs:
7878
- notify_failing_main
7979

8080
prepare-agents:
81-
machine:
82-
image: *linux_machine_image
83-
resource_class: large
81+
docker:
82+
- image: *go_image
83+
resource_class: circleci-runner/rum-large
8484
steps:
8585
- checkout
86-
- docker_login
8786
- run: ./do build-fake-agents
88-
- run: ./do download-taskagents
8987
- persist_to_workspace:
9088
root: .
9189
paths:

‎CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ By following these guidelines, we can easily determine which changes should be i
1010

1111
## Edge
1212

13-
- [#10] [INTERNAL] Set up linting tools, initiated a changelog, and performed other configurations in preparation for the orchestration agent.
13+
- [#11](https://github.com/circleci/runner-init/pull/11) [INTERNAL] Download task agent binaries directly via the Dockerfile.
14+
- [#10](https://github.com/circleci/runner-init/pull/10) [INTERNAL] Set up linting tools, initiated a changelog, and performed other configurations in preparation for the orchestration agent.

‎do

-12
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,6 @@ set -eu -o pipefail
55
reportDir="test-reports"
66
GORELEASER_VERSION="v1.26.2"
77

8-
# This variable is used, but shellcheck can't tell.
9-
# shellcheck disable=SC2034
10-
help_download_taskagents="Download task agents via the picard image"
11-
download-taskagents() {
12-
id=$(docker create circleci/picard:agent)
13-
14-
docker cp "$id":/opt/circleci/linux/amd64/circleci-agent ./bin/circleci-agent-amd64
15-
docker cp "$id":/opt/circleci/linux/arm64/circleci-agent ./bin/circleci-agent-arm64
16-
17-
docker rm -v "$id"
18-
}
19-
208
# This variable is used, but shellcheck can't tell.
219
# shellcheck disable=SC2034
2210
help_build_fake_agents="Build the fake agent go binaries"

‎runner-init/Dockerfile

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
FROM circleci/picard:agent as task-agent-image
2+
13
FROM busybox:stable-musl
24

35
ARG ARCH=amd64
46

5-
COPY ./bin/circleci-agent-${ARCH} /opt/circleci/circleci-agent
7+
COPY --from=task-agent-image /opt/circleci/linux/${ARCH}/circleci-agent /opt/circleci/bin/circleci-agent
68
COPY ./runner-init/init.sh /init.sh
79

8-
ENTRYPOINT ["/init.sh"]
10+
ENTRYPOINT ["/init.sh"]

‎runner-init/fake-agent.Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM busybox:stable-musl as build
22

33
ARG ARCH=amd64
44

5-
COPY ./bin/circleci-fake-agent-${ARCH} /opt/circleci/circleci-agent
5+
COPY ./bin/circleci-fake-agent-${ARCH} /opt/circleci/bin/circleci-agent
66
COPY ./runner-init/init.sh /init.sh
77

8-
ENTRYPOINT ["/init.sh"]
8+
ENTRYPOINT ["/init.sh"]

‎runner-init/init.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
dest=${1:?'task agent dest must be specified'}
44

5-
cp /opt/circleci/circleci-agent "$dest"/circleci-agent
5+
cp /opt/circleci/bin/circleci-agent "$dest"/circleci-agent
66
ln -s "$dest"/circleci-agent "$dest"/circleci

0 commit comments

Comments
 (0)
Failed to load comments.