Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V6 #1131

Merged
merged 110 commits into from
Jul 26, 2023
Merged

V6 #1131

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
9cc368e
Switch base AMI to Amazon Linux 2023
triarius Mar 20, 2023
0a59a3b
Bump packer to v1.8.6
triarius Mar 21, 2023
2a72f01
Remove python2 and install aws-cli v2 from repos
triarius Mar 21, 2023
883da24
Replace docker-gc cron jobs with systemd timers
triarius May 30, 2023
6c6bd3e
Remove docker-compose v1
triarius May 30, 2023
25a9da8
Remove qemu and qemu-user-static packages
triarius May 30, 2023
23b3db8
Remove upgrade of signature
triarius Jun 5, 2023
6ca45e4
Switch to manual install of goss and install dgoss as well
triarius Jun 5, 2023
4f99405
Fewer tabs in bk-install-elastic-stack.sh
triarius Jun 5, 2023
2143bda
Use a single command to start and enable systemd units
triarius Jun 5, 2023
eca2fe2
Bump docker compose to v2.18.1 and install docker from repos
triarius Jun 5, 2023
3c57da5
Convert refresh authorized_keys cron into systemd timer
triarius Jun 5, 2023
9c0d053
Use curl instead of ec2-metadata tool
triarius Jun 5, 2023
2d32dfc
Consolidate packer install scripts
triarius Jun 5, 2023
734e9ce
Install all utils in single command
triarius Jun 5, 2023
214f529
Remove ssm plugin
triarius Jun 5, 2023
b8a23e1
Update sshd home dir expectation
triarius Jun 5, 2023
e8e41a8
Update expected docker group id
triarius Jun 5, 2023
6ecfbf0
Replace cloud-boothook with x-shellscript
triarius Jun 5, 2023
f12eed1
Update subgid for docker group
triarius Jun 5, 2023
406d9ff
Fix logging and standardise formatting in some startup scripts
triarius Jun 5, 2023
07a7a1b
Add a comment about userns
triarius Jun 6, 2023
6a7667c
Remove unnecessary quotes in goss file
triarius Jun 6, 2023
198c8bc
Add checks that docker is configured correctly
triarius Jun 6, 2023
96510d4
Remove docker info goss test and update comments
triarius Jun 6, 2023
da56b78
Escape go templating
triarius Jun 6, 2023
b4be589
Restart docker daemon after setting userns
triarius Jun 6, 2023
2e25e00
Remove default instance in systemd
triarius Jun 6, 2023
e1e9479
Install, start, and enable ssm-agent
triarius Jun 6, 2023
c0b6d97
Print more informative steps during docker installation
triarius Jun 6, 2023
d290926
Install qemu-binfmt using docker container on boot
triarius Jun 6, 2023
7755a93
Add GOSS test for amazon-ssm-agent
triarius Jun 6, 2023
974b2b9
Remove goss timeouts
triarius Jun 6, 2023
b4afa48
Test multiarch with goss
triarius Jun 6, 2023
3e4cd66
Rightsize test instances
triarius Jun 6, 2023
00e7a8b
Add explicit 30s timeout to all goss assertions that pull docker images
triarius Jun 6, 2023
9272fb7
Change docker info output to show which elements of a list are presen…
triarius Jun 7, 2023
cf65a21
Revert "Revert " Rename the parameter `EnableGitMirrorsExperiment` to…
triarius Jun 7, 2023
1e65a5b
Remove Spot Price Parameter
triarius Jun 8, 2023
e7cb800
Add parameter for SpotAllocationStrategy
triarius Jun 8, 2023
1c6e3c3
Rename SecurityGroupId to SecurityGroupIds
triarius Jun 8, 2023
bd08fa2
Publish to both `main` and `master` for the time being
triarius Jun 8, 2023
8d3cb68
Merge pull request #1125 from buildkite/revert-1124-revert-1123-oss-3…
triarius Jun 9, 2023
d213736
Merge pull request #1128 from buildkite/pdp-1108-rename-securitygroup…
triarius Jun 9, 2023
d0bb6f2
Fix goss docker info commands
triarius Jun 7, 2023
3c7c3a5
Use case statement to determine ARCH in packer/linux/conf/bin/bk-inst…
triarius Jun 7, 2023
b4da072
Make `capacity-optimized` the default spot allocation strategy
triarius Jun 9, 2023
83d6a06
Merge pull request #1122 from buildkite/pdp-695-amazon-linux-2023-for…
triarius Jun 9, 2023
8ae70cf
Explicitly add wget to the stack
triarius Jun 9, 2023
a26450e
Merge pull request #1133 from buildkite/pdp-1116-add-wget-to-elastic-…
triarius Jun 9, 2023
4003612
Install some tools that were not installed on AL2023 by default
triarius Jun 9, 2023
5b54890
Check for the existence of some tools
triarius Jun 9, 2023
7b37cc5
Use unversioned python installs
triarius Jun 10, 2023
245cfc2
Replace yum with dnf
triarius Jun 10, 2023
e3b7e6d
Guard against `BUILDKITE_AGENT_ENABLE_GIT_MIRRORS` not being set in s…
triarius Jun 12, 2023
4ab35bb
Merge pull request #1135 from buildkite/pdp-1118-guard-against-buildk…
triarius Jun 12, 2023
d479f4f
Merge pull request #1134 from buildkite/pdp-1117-install-some-tools-t…
triarius Jun 12, 2023
1bef48f
Merge branch 'pdp-1120-installing-docker-on-elastic-ci-stack-no-longe…
triarius Jun 15, 2023
111219c
Pluralize ManagedPolicyARNs
triarius Jun 19, 2023
96780f5
Merge pull request #1130 from buildkite/pdp-1107-remove-spot-price-pa…
triarius Jun 15, 2023
c76dd43
Pluralize IntanceTypes
triarius Jun 19, 2023
33f33cc
Default InstanceName to stack name
triarius Jun 15, 2023
a3853f7
Merge pull request #1129 from buildkite/pdp-1109-publish-to-both-mast…
triarius Jun 15, 2023
10d40f0
Add i4g instance type to map or ARM64 instance types
triarius Jun 19, 2023
2707b17
Merge pull request #1137 from buildkite/pdp-1132-default-the-instance…
triarius Jun 16, 2023
eb72d40
Pull tonistiigi/binfmt in packer
triarius Jun 20, 2023
50a402b
Use same version of tonistiigi/binfmt on pull and run
triarius Jun 20, 2023
cd07650
Use a digest to pin the image
triarius Jun 20, 2023
ccd0973
Merge pull request #1138 from buildkite/pdp-1142-pluralise-some-stack…
triarius Jun 20, 2023
50abd80
Allow the MaxSize to be 0
triarius Jun 21, 2023
d6627ec
Merge pull request #1139 from buildkite/pdp-1146-pull-docker-images-i…
triarius Jun 21, 2023
a24c2c1
Merge pull request #1140 from buildkite/pdp-1151-allow-maxsize-to-be-0
triarius Jun 21, 2023
35caf88
Fix path to cfn-signal in install scripts
triarius Jun 27, 2023
16ef5b4
Merge pull request #1145 from buildkite/pdp-1226-fix-path-to-cfn-sign…
triarius Jun 27, 2023
d21d893
Increase cancel grace period to 60s
triarius Jun 27, 2023
469b85e
Merge pull request #1144 from buildkite/pdp-1225-increase-grace-perio…
triarius Jun 27, 2023
cb47acc
Update changelog for v6.0.0-beta1
triarius Jun 27, 2023
ef02a6a
Merge pull request #1146 from buildkite/pdp-1231-tag-v600-beta
triarius Jun 28, 2023
c952ed8
Create script to prepend `--compatibility` flag to docker-compose
triarius Jul 2, 2023
33c2106
Install docker-compose compat srcipt
triarius Jul 2, 2023
62dbff8
Add warning about unbounded recursion
triarius Jul 2, 2023
e0699b8
Bump docker compose to v2.19.1 and buildx to v0.11.0
triarius Jul 2, 2023
435a4c2
Merge pull request #1148 from buildkite/pdp-1277-append-compatibility…
triarius Jul 3, 2023
130a7be
Don't chown /etc/docker to ec2-user:docker
triarius Jul 3, 2023
04a5d38
Clarify a comment
triarius Jul 3, 2023
001fb33
Remove hardcoded subuid and subgid with dynamic values
triarius Jul 3, 2023
9f260ce
Formatting change
triarius Jul 3, 2023
9aed820
Install multiarch in configure docker script
triarius Jul 3, 2023
4705f8e
Build docker image as part of testing elastic ci stack
triarius Jul 3, 2023
fbdc581
Fix spelling
triarius Jul 3, 2023
c039f63
Clean up formatting of install-docker.sh
triarius Jul 3, 2023
2ab8737
Move Dockerfile
triarius Jul 5, 2023
770caf8
Bump docker compose to v2.20.0 and buildx to v0.11.1
triarius Jul 13, 2023
0d1b0a6
Merge pull request #1149 from buildkite/pdp-1276-fix-first-build-of-d…
triarius Jul 17, 2023
173c4fb
Merge pull request #1150 from buildkite/pdp-1318-bump-docker-compose-…
triarius Jul 17, 2023
54da647
Update changelog for v6.0.0-beta2
triarius Jul 17, 2023
2e98ada
Merge pull request #1151 from buildkite/pdp-1314-tag-v600-beta2
triarius Jul 17, 2023
ec5c998
Bump buildx to v0.11.2
triarius Jul 19, 2023
c0a4d5d
Bump buildkite-agent to v3.50.2
triarius Jul 23, 2023
550211a
Bump docker compose to v2.20.2
triarius Jul 23, 2023
b59c5e7
Merge pull request #1162 from buildkite/pdp-1356-bump-versions-of-doc…
triarius Jul 24, 2023
e34ae69
Exit status 2 when environment hook fails
triarius Jul 24, 2023
fb6a477
Merge pull request #1163 from buildkite/pdp-1369-exit-status-2-when-e…
triarius Jul 24, 2023
8cc2a11
Bump buildkite-agent to v3.50.3
triarius Jul 24, 2023
380a6ec
Merge branch 'master' into v6
triarius Jul 24, 2023
eee95e6
Correct grammar in an error message
triarius Jul 24, 2023
3efd3e8
Merge pull request #1165 from buildkite/triarius/bump-agent-3.50.3
moskyb Jul 24, 2023
06e42c5
Merge pull request #1166 from buildkite/triarius/fix-spelling
triarius Jul 24, 2023
53851b0
Merge pull request #1168 from buildkite/pdp-1373-resolve-merge-confli…
triarius Jul 25, 2023
0efd182
Merge remote-tracking branch 'origin/master' into v6
triarius Jul 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .buildkite/steps/launch.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
set -eu
set -euo pipefail

os="${1:-linux}"
arch="${2:-amd64}"
Expand All @@ -22,16 +22,16 @@ echo "Using AMI $image_id for $os/$arch"
service_role="$(buildkite-agent meta-data get service-role-arn)"
echo "Using service role ${service_role}"

instance_type="t3.nano"
instance_type="t3.small"
instance_disk="10"

if [[ "$os" == "windows" ]] ; then
if [[ "$os" == "windows" ]]; then
instance_type="m5.large"
instance_disk="100"
fi

if [[ "$arch" == "arm64" ]] ; then
instance_type="m6g.large"
if [[ "$arch" == "arm64" ]]; then
instance_type="t4g.small"
fi

cat << EOF > config.json
Expand All @@ -49,7 +49,7 @@ cat << EOF > config.json
"ParameterValue": "${AWS_KEYPAIR:-aws-stack-test}"
},
{
"ParameterKey": "InstanceType",
"ParameterKey": "InstanceTypes",
"ParameterValue": "${instance_type}"
},
{
Expand Down Expand Up @@ -89,7 +89,7 @@ cat << EOF > config.json
"ParameterValue": "true"
},
{
"ParameterKey": "EnableAgentGitMirrorsExperiment",
"ParameterKey": "BuildkiteAgentEnableGitMirrors",
"ParameterValue": "true"
},
{
Expand Down
28 changes: 22 additions & 6 deletions .buildkite/steps/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,28 @@ else
echo "Skipping publishing latest, '$BUILDKITE_TAG' doesn't match '$(git describe origin/master --tags --match='v*')'"
fi

# Publish the most recent commit from each branch
s3_upload_templates "${BUILDKITE_BRANCH}/"
publish_for_branch() {
local branch="$1"

# Publish each build to a unique URL, to let people roll back to old versions
s3_upload_templates "${BUILDKITE_BRANCH}/${BUILDKITE_COMMIT}."
# Publish the most recent commit from each branch
s3_upload_templates "${branch}/"

cat << EOF | buildkite-agent annotate --style "info"
Published template <a href="https://s3.amazonaws.com/${BUILDKITE_AWS_STACK_TEMPLATE_BUCKET}/${BUILDKITE_BRANCH}/aws-stack.yml">${BUILDKITE_BRANCH}/aws-stack.yml</a>
# Publish each build to a unique URL, to let people roll back to old versions
s3_upload_templates "${branch}/${BUILDKITE_COMMIT}."

cat << EOF | buildkite-agent annotate --style "info"
Published template <a href="https://s3.amazonaws.com/${BUILDKITE_AWS_STACK_TEMPLATE_BUCKET}/${branch}/aws-stack.yml">${branch}/aws-stack.yml</a>
EOF
}

if [[ "$BUILDKITE_BRANCH" != "$BUILDKITE_PIPELINE_DEFAULT_BRANCH" ]]; then
publish_for_branch "$BUILDKITE_BRANCH"

exit 0
fi

# TODO: remove "master" from this list
default_branch_aliases=(master main)
for branch in "${default_branch_aliases[@]}"; do
publish_for_branch "$branch"
done
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,42 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [v6.0.0](https://github.com/buildkite/elastic-ci-stack-for-aws/tree/v6.0.0) (2023-07-25)
[Full Changelog](https://github.com/buildkite/elastic-ci-stack-for-aws/compare/v5.22.2...v6.0.0)

### Changed
- Upgrade base image to Amazon Linux 2023 [#1122](https://github.com/buildkite/elastic-ci-stack-for-aws/pull/1122) (@triarius)
- Many packages have been added, upgraded, or removed since Amazon Linux 2. We've explicitly called out what's been intentionally left out by us below. Refer to [docs.aws.amazon.com/linux/al2023/ug/compare-with-al2.html](https://docs.aws.amazon.com/linux/al2023/ug/compare-with-al2.html) for the changes Amazon have made.
- Publish template to both `main` and `master` [#1129](https://github.com/buildkite/elastic-ci-stack-for-aws/pull/1129) (@triarius)
- Increase job cancel grace period to 60s [#1144](https://github.com/buildkite/elastic-ci-stack-for-aws/pull/1144) (@triarius)
- Allow the `MaxSize` to be 0 [#1140](https://github.com/buildkite/elastic-ci-stack-for-aws/pull/1140) (@triarius)
- Default EC2 instance names to stack name [#1137](https://github.com/buildkite/elastic-ci-stack-for-aws/pull/1137) (@triarius)
- Rename the parameter `InstanceType` to `InstanceTypes` [#1138](https://github.com/buildkite/elastic-ci-stack-for-aws/pull/1138) (@triarius)
- Rename the parameter `ManagedPolicyARN` to `ManagedPolicyARNs` [#1138](https://github.com/buildkite/elastic-ci-stack-for-aws/pull/1138) (@triarius)
- Rename the parameter `SecurityGroupId` to `SecurityGroupIds` [#1128](https://github.com/buildkite/elastic-ci-stack-for-aws/pull/1128) (@triarius)
- Rename the parameter `EnableAgentGitMirrorsExperiment` to `BuildkiteAgentEnableGitMirrors` [#1123](https://github.com/buildkite/elastic-ci-stack-for-aws/pull/1123) (@triarius)
- Enable the `ansi-timestamps` setting if and only if `BuildkiteAgentTimestampLines` parameter is `"false"` [#1132](https://github.com/buildkite/elastic-ci-stack-for-aws/pull/1132) (@triarius)
- Bump docker compose to v2.20.2 [#1150](https://github.com/buildkite/elastic-ci-stack-for-aws/pull/1150) (@triarius)
- Bump buildx to v0.11.2 [#1150](https://github.com/buildkite/elastic-ci-stack-for-aws/pull/1150) (@triarius)

### Added
- Support running and building multi-platform docker images [#1139](https://github.com/buildkite/elastic-ci-stack-for-aws/pull/1139) [#1122](https://github.com/buildkite/elastic-ci-stack-for-aws/pull/1122) [#1149](https://github.com/buildkite/elastic-ci-stack-for-aws/pull/1149) (@triarius)
- Support i4g instance types [#1138](https://github.com/buildkite/elastic-ci-stack-for-aws/pull/1138) (@triarius)
- Added the parameter `SpotAllocationStrategy` [#1130](https://github.com/buildkite/elastic-ci-stack-for-aws/pull/1130) (@triarius)

### Fixed
- Guard against `BUILDKITE_AGENT_ENABLE_GIT_MIRRORS` not being set in startup script [#1135](https://github.com/buildkite/elastic-ci-stack-for-aws/pull/1135) (@triarius)

### Removed
- Remove deprecated `SpotPrice` parameter [#1130](https://github.com/buildkite/elastic-ci-stack-for-aws/pull/1130) (@triarius)
- Removed packages. These packages are either not available on Amazon Linux 2023, or not installed by default on the base image we use. We have decided to not install them as suitable replacements may be found.
- Python 2
- OpenSSL v1.0
- AWS CLI v1
- Docker-Compose v1
- The `docker-compose` executable will prepend the `--compatibility` flag to docker-compose v2 [#1148](https://github.com/buildkite/elastic-ci-stack-for-aws/pull/1148) (@triarius)
- Cronie

## [v5.22.2](https://github.com/buildkite/elastic-ci-stack-for-aws/tree/v5.22.2) (2023-07-24)
[Full Changelog](https://github.com/buildkite/elastic-ci-stack-for-aws/compare/v5.22.1...v5.22.2)

Expand All @@ -12,6 +48,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Internal
- Set `allow_dependency_failure: true` on stack cleanup jobs [#1159](https://github.com/buildkite/elastic-ci-stack-for-aws/pull/1159) (@triarius)

## [v5.22.1](https://github.com/buildkite/elastic-ci-stack-for-aws/tree/v5.22.1) (2023-07-21)
[Full Changelog](https://github.com/buildkite/elastic-ci-stack-for-aws/compare/v5.22.0...v5.22.1)

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
VERSION = $(shell git describe --tags --candidates=1)
SHELL = /bin/bash -o pipefail

PACKER_VERSION ?= 1.6.2
PACKER_VERSION ?= 1.8.6
PACKER_LINUX_FILES = $(exec find packer/linux)
PACKER_WINDOWS_FILES = $(exec find packer/windows)

Expand Down
35 changes: 17 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,22 @@ of per-operating system support:

Feature | Linux | Windows
--- | --- | ---
Docker | ✅ | ✅
Docker Compose | ✅ | ✅
AWS CLI | ✅ | ✅
S3 Secrets Bucket | ✅ | ✅
ECR Login | ✅ | ✅
Docker Login | ✅ | ✅
CloudWatch Logs Agent | ✅ | ✅
Per-Instance Bootstrap Script | ✅ | ✅
🧑‍🔬 git-mirrors experiment | ✅ | ✅
SSM Access | ✅ | ✅
Instance Storage (NVMe) | ✅ |
SSH Access | ✅ |
Periodic authorized_keys Refresh | ✅ |
Periodic Instance Health Check | ✅ |
git lfs | ✅ |
Additional sudo Permissions | ✅ |
RDP Access | | ✅
Docker | ✅ | ✅
Docker Compose | ✅ | ✅
AWS CLI | ✅ | ✅
S3 Secrets Bucket | ✅ | ✅
ECR Login | ✅ | ✅
Docker Login | ✅ | ✅
CloudWatch Logs Agent | ✅ | ✅
Per-Instance Bootstrap Script | ✅ | ✅
SSM Access | ✅ | ✅
Instance Storage (NVMe) | ✅ |
SSH Access | ✅ |
Periodic authorized_keys Refresh | ✅ |
Periodic Instance Health Check | ✅ |
git lfs | ✅ |
Additional sudo Permissions | ✅ |
RDP Access | | ✅

## Security

Expand Down Expand Up @@ -154,7 +153,7 @@ You may wish to preview any updates to your stack from this template
[using a CloudFormation Stack Change Set](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-changesets.html)
to decide whether to apply it.

## Recommended reading
## Recommended reading

To gain a better understanding of how Elastic CI Stack works and how to use it most effectively and securely, see the following resources:

Expand Down
87 changes: 71 additions & 16 deletions goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ service:
enabled: true
running: true

amazon-ssm-agent:
enabled: true
running: true

docker:
enabled: true
running: true
Expand Down Expand Up @@ -73,7 +77,7 @@ user:
gid: 74
groups:
- sshd
home: /var/empty/sshd
home: /usr/share/empty.sshd
shell: /sbin/nologin

group:
Expand All @@ -83,7 +87,7 @@ group:

docker:
exists: true
gid: 1001
gid: 993

sshd:
exists: true
Expand All @@ -100,34 +104,85 @@ process:
running: true

command:
"aws --version":
aws --version:
exit-status: 0

curl --version:
exit-status: 0

dig -h:
exit-status: 0

git --version:
exit-status: 0

git-lfs --version:
exit-status: 0

command -v lsof:
exit-status: 0

make --version:
exit-status: 0

"git --version":
wget --version:
exit-status: 0

"git-lfs --version":
systemctl is-enabled docker-gc.timer:
exit-status: 0

"/etc/cron.hourly/docker-low-disk-gc":
/usr/local/bin/docker-gc:
exit-status: 0

"/etc/cron.hourly/docker-gc":
systemctl is-enabled docker-low-disk-gc.timer:
exit-status: 0

# Checks that docker is running
"docker info":
/usr/local/bin/docker-low-disk-gc:
exit-status: 0
timeout: 30000 # it can take some time for the daemon to start

# Checks that docker containers can run
"docker run --rm -v /var/run/docker.sock:/var/run/docker.sock docker:latest version":
docker buildx build -f tests/Dockerfile --progress=plain -t buildkite-postgres:latest tests:
exit-status: 0
timeout: 30000 # it can take some time to download the image
timeout: 30000

# Checks that permissions
'sh -c "docker run --rm -v \"$PWD:/pwd\" alpine:latest touch /pwd/test && stat -c %U:%G test"':
# Check docker userns is enabled
# Note that goss will evaluate the outer layer of templating, and docker will evaluate the second
# Running `goss validate --format documentation` will print this with the first layer of templating evaluated
'{{ `docker info --format=",{{range .SecurityOptions}}{{.}},{{end}}"` }}':
exit-status: 0
timeout: 30000 # it can take some time to download the image
timeout: 30000
stdout:
- /,name=userns,/

# Check docker plugins are installed
# Note that goss will evaluate the first layer of templating, and docker will evaluate the second
# Running `goss validate --format documentation` will print this with the first layer of templating evaluated
'{{ `docker info --format=",{{range .ClientInfo.Plugins}}{{.Name}},{{end}}"` }}':
exit-status: 0
timeout: 30000
stdout:
- /,buildx,/
- /,compose,/

# Check that docker containers can run
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock docker:latest version:
exit-status: 0
timeout: 30000

# Check that userns allows writing as buildkite-agent
sh -c 'docker run --rm -v "$PWD:/pwd" alpine:latest touch /pwd/test && stat -c %U:%G test' && rm test:
exit-status: 0
timeout: 30000
stdout:
- buildkite-agent:docker

docker run --rm -t arm64v8/ubuntu uname -m:
exit-status: 0
timeout: 30000
stdout:
- aarch64

docker run --rm -t amd64/ubuntu uname -m:
exit-status: 0
timeout: 30000
stdout:
- x86_64
30 changes: 4 additions & 26 deletions packer/linux/buildkite-ami.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"region": "{{user `region`}}",
"source_ami_filter": {
"filters": {
"name": "amzn2-ami-kernel-5.10-hvm-2.0.*-gp2",
"name": "al2023-ami-minimal-2023.0.*.*-kernel-*",
"architecture": "{{user `arch`}}",
"virtualization-type": "hvm"
},
Expand All @@ -21,7 +21,7 @@
"instance_type": "{{user `instance_type`}}",
"ssh_username": "ec2-user",
"ami_name": "buildkite-stack-linux-{{user `arch`}}-{{isotime | clean_resource_name}}",
"ami_description": "Buildkite Elastic Stack (Amazon Linux 2 LTS w/ docker)",
"ami_description": "Buildkite Elastic Stack (Amazon Linux 2023 w/ docker)",
"ami_groups": ["all"]
}
],
Expand All @@ -44,10 +44,6 @@
"type": "shell",
"script": "scripts/install-cloudwatch-agent.sh"
},
{
"type": "shell",
"script": "scripts/install-lifecycled.sh"
},
{
"type": "shell",
"script": "scripts/install-docker.sh"
Expand All @@ -58,29 +54,11 @@
},
{
"type": "shell",
"script": "scripts/install-s3secrets-helper.sh"
},
{
"type": "shell",
"script": "scripts/install-git-lfs.sh"
},
{
"type": "shell",
"script": "scripts/install-session-manager-plugin.sh"
},
{
"type": "shell",
"script": "scripts/install-nvme-cli.sh"
},
{
"type": "shell",
"script": "scripts/upgrade-kernel.sh"
"script": "scripts/install-buildkite-utils.sh"
},
{
"type": "shell",
"inline": [
"rm /home/ec2-user/.ssh/authorized_keys"
]
"inline": ["rm /home/ec2-user/.ssh/authorized_keys"]
}
]
}
Loading