Skip to content

Commit 9601daa

Browse files
amazon-autothomas-roos
authored andcommitted
Initial commit
0 parents  commit 9601daa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+4026
-0
lines changed

.eslintignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
npm_modules/
2+
dist/
3+
cdk.out/

.github/workflows/test-cdk.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Test CDK
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches: ["**"]
6+
paths: ["lib/**"]
7+
pull_request:
8+
branches: [master]
9+
paths: ["lib/**"]
10+
jobs:
11+
Run-CDK-Tests:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [16.x, 18.x, 20.x]
17+
18+
steps:
19+
- name: Check out repository code
20+
uses: actions/checkout@v3
21+
- name: Use Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v3
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
- run: npm ci
26+
- run: npm run check
27+
- run: npm run build --if-present
28+
- run: npm test

.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*.js
2+
!jest.config.js
3+
*.d.ts
4+
node_modules
5+
dist
6+
7+
# CDK asset staging directory
8+
.cdk.staging
9+
cdk.out

.npmignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*.ts
2+
!*.d.ts
3+
4+
# CDK asset staging directory
5+
.cdk.staging
6+
cdk.out

LICENSE.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Amazon.com, Inc. All Rights Reserved.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# aws4embeddedlinux-build
2+
3+
This repository contains [buildbot](https://buildbot.net/) using [AWS CDK](https://aws.amazon.com/cdk/) to run [Yocto](https://www.yoctoproject.org/) embedded Linux build jobs in AWS.
4+
5+
6+
## Code structure
7+
8+
This is a standard CDK project.
9+
10+
The main stack definition can be found in [`lib/app.ts`](lib/app.ts).
11+
12+
13+
## Requirements and deployment
14+
15+
In order to be able to deploy this CDK project you need to have the following:
16+
17+
- An AWS account
18+
- The [AWS CLI](https://aws.amazon.com/cli/) installed and configured in your development machine
19+
- [AWS CDK](https://aws.amazon.com/cdk/) installed and configured in your development machine
20+
- Node.js and npm installed
21+
22+
Then to deploy this CDK project to your AWS account, you simply have to clone this repository and from the root folder of the project run:
23+
24+
```bash
25+
npm install
26+
```
27+
28+
To install the necessary dependencies, and then:
29+
30+
```bash
31+
npm run build
32+
npm run zip-config
33+
cdk deploy --all
34+
```
35+
36+
To synthesise and deploy the project stack.
37+
38+
Then prompt `y` for yes.
39+
40+
If you want to clean up your account you can delete this stack with:
41+
42+
```bash
43+
cdk destroy
44+
```
45+
46+
47+
## Contributing
48+
49+
Everyone is very welcome to contribute to this project.
50+
You can contribute just by submitting bugs or suggesting improvements by
51+
opening an issue on GitHub.
52+
53+
54+
## License
55+
56+
Licensed under [MIT License](LICENSE.md).

cdk.context.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"availability-zones:account=743600277648:region=eu-central-1": ["eu-central-1a", "eu-central-1b", "eu-central-1c"]
3+
}

cdk.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"app": "node dist/lib/app",
3+
"amzn": {
4+
"cdk-build": {
5+
"build": "npm-pretty-much",
6+
"version": 1
7+
}
8+
},
9+
"output": "dist/cdk.out"
10+
}

configuration/admin/.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.zip

configuration/admin/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.zip
2+
venv/

configuration/admin/Dockerfile

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
FROM public.ecr.aws/lts/ubuntu:22.04_stable
2+
3+
RUN apt-get update && apt-get install -y build-essential python3-dev libssl-dev \
4+
libffi-dev python3-pip python3-venv git
5+
6+
# DEBUG
7+
RUN apt-get install -y psmisc vim lsof nmap iputils-ping curl
8+
# DEBUG
9+
10+
RUN useradd -U -m user
11+
12+
USER user
13+
WORKDIR /home/user
14+
15+
EXPOSE 8010
16+
EXPOSE 9989
17+
18+
RUN python3 -m pip install --upgrade pip
19+
RUN python3 -m pip install boto3 botocore
20+
RUN python3 -m pip install git-remote-codecommit
21+
RUN python3 -m pip install 'buildbot[bundle]'
22+
23+
ENV PATH="/home/user/.local/bin:${PATH}"
24+
25+
RUN buildbot create-master .
26+
COPY admin.cfg .
27+
COPY envfile .
28+
COPY entry.sh .
29+
RUN mkdir userconfig
30+
RUN chown -R user: userconfiguration/
31+
COPY user.cfg userconfiguration/
32+
33+
ENTRYPOINT [ "./entry.sh" ]

configuration/admin/README.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Setting up:
2+
3+
* Deploy source bucket and pipeline then use the bucket name below.
4+
5+
```
6+
# Zip the needed files.
7+
zip -o config.zip buildspec.yml Dockerfile entry.sh master.cfg
8+
9+
# S3 CP to the config key.
10+
aws --profile PROFILE s3 cp config.zip s3://BUCKET/config
11+
```
12+
13+
Running locally:
14+
```
15+
docker build -t buildbot:latest .
16+
17+
# Does not include worker port, found in the master.cfg
18+
docker run -p 8010:8010 buildbot:latest
19+
```
20+
21+
Development Setup
22+
```
23+
python3 -m venv venv
24+
. ./venv/bin/activate
25+
pip install -r dev-requirements.txt
26+
```
27+

0 commit comments

Comments
 (0)