Skip to content

Commit

Permalink
feat(superchain): add Amazon SSM agent (#3819)
Browse files Browse the repository at this point in the history
Add the Amazon SSM agent to our image, so that we will be able to debug builds using the CodeBuild `<->` SSM breakpoint feature.



---

By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license].

[Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
  • Loading branch information
rix0rrr authored Nov 2, 2022
1 parent e9d4084 commit d3c3b17
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 1 deletion.
2 changes: 1 addition & 1 deletion jest.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const config = {
// quickly run out of control, and make everything very, very slow.)
maxConcurrency: Math.max(Math.min(cpus().length - 1, 4), 2),
// When in Continuous Integration, allow double the default test timeout (assuming "frugal" runner type)
testTimeout: env.CI === 'true' ? 10_000 : undefined,
testTimeout: env.CI === 'true' ? 30_000 : undefined,
};

/**
Expand Down
11 changes: 11 additions & 0 deletions superchain/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,17 @@ RUN apt-key add /tmp/nodesource.asc && rm /tmp/nodesource.asc
RUN pip install aws-sam-cli \
&& sam --version

# Install Amazon SSM agent (allows debugging of builds via `codebuild-breakpoint`, https://go.aws/3TVW7vL)
RUN apt-get update \
&& apt-get -y install curl \
&& curl -fSsL "https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/debian_${TARGETPLATFORM#linux/}/amazon-ssm-agent.deb" \
-o /tmp/amazon-ssm-agent.deb \
&& dpkg -i /tmp/amazon-ssm-agent.deb \
&& systemctl enable amazon-ssm-agent \
&& rm -rf /var/lib/apt/lists/*
COPY --chown=superchain:superchain superchain/amazon-ssm-agent.json /etc/amazon/ssm/amazon-ssm-agent.json


# Install some configuration
COPY superchain/ssh_config /root/.ssh/config
RUN chmod 600 /root/.ssh/config
Expand Down
45 changes: 45 additions & 0 deletions superchain/amazon-ssm-agent.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"Profile":{
"ShareCreds" : true,
"ShareProfile" : ""
},
"Mds": {
"CommandWorkersLimit" : 5,
"StopTimeoutMillis" : 20000,
"Endpoint": "",
"CommandRetryLimit": 15
},
"Ssm": {
"Endpoint": "",
"HealthFrequencyMinutes": 5,
"CustomInventoryDefaultLocation" : "",
"AssociationLogsRetentionDurationHours" : 24,
"RunCommandLogsRetentionDurationHours" : 336,
"SessionLogsRetentionDurationHours" : 336
},
"Mgs": {
"Region": "",
"Endpoint": "",
"StopTimeoutMillis" : 20000,
"SessionWorkersLimit" : 1000
},
"Agent": {
"Region": "",
"OrchestrationRootDir": "",
"ContainerMode": true
},
"Os": {
"Lang": "en-US",
"Name": "",
"Version": "1"
},
"S3": {
"Endpoint": "",
"Region": "",
"LogBucket":"",
"LogKey":""
},
"Kms": {
"Endpoint": ""
}
}

0 comments on commit d3c3b17

Please sign in to comment.