-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 9601daa
Showing
41 changed files
with
4,026 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
npm_modules/ | ||
dist/ | ||
cdk.out/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Test CDK | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: ["**"] | ||
paths: ["lib/**"] | ||
pull_request: | ||
branches: [master] | ||
paths: ["lib/**"] | ||
jobs: | ||
Run-CDK-Tests: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [16.x, 18.x, 20.x] | ||
|
||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v3 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- run: npm ci | ||
- run: npm run check | ||
- run: npm run build --if-present | ||
- run: npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
*.js | ||
!jest.config.js | ||
*.d.ts | ||
node_modules | ||
dist | ||
|
||
# CDK asset staging directory | ||
.cdk.staging | ||
cdk.out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
*.ts | ||
!*.d.ts | ||
|
||
# CDK asset staging directory | ||
.cdk.staging | ||
cdk.out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) Amazon.com, Inc. All Rights Reserved. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# aws4embeddedlinux-build | ||
|
||
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. | ||
|
||
|
||
## Code structure | ||
|
||
This is a standard CDK project. | ||
|
||
The main stack definition can be found in [`lib/app.ts`](lib/app.ts). | ||
|
||
|
||
## Requirements and deployment | ||
|
||
In order to be able to deploy this CDK project you need to have the following: | ||
|
||
- An AWS account | ||
- The [AWS CLI](https://aws.amazon.com/cli/) installed and configured in your development machine | ||
- [AWS CDK](https://aws.amazon.com/cdk/) installed and configured in your development machine | ||
- Node.js and npm installed | ||
|
||
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: | ||
|
||
```bash | ||
npm install | ||
``` | ||
|
||
To install the necessary dependencies, and then: | ||
|
||
```bash | ||
npm run build | ||
npm run zip-config | ||
cdk deploy --all | ||
``` | ||
|
||
To synthesise and deploy the project stack. | ||
|
||
Then prompt `y` for yes. | ||
|
||
If you want to clean up your account you can delete this stack with: | ||
|
||
```bash | ||
cdk destroy | ||
``` | ||
|
||
|
||
## Contributing | ||
|
||
Everyone is very welcome to contribute to this project. | ||
You can contribute just by submitting bugs or suggesting improvements by | ||
opening an issue on GitHub. | ||
|
||
|
||
## License | ||
|
||
Licensed under [MIT License](LICENSE.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"availability-zones:account=743600277648:region=eu-central-1": ["eu-central-1a", "eu-central-1b", "eu-central-1c"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"app": "node dist/lib/app", | ||
"amzn": { | ||
"cdk-build": { | ||
"build": "npm-pretty-much", | ||
"version": 1 | ||
} | ||
}, | ||
"output": "dist/cdk.out" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.zip | ||
venv/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
FROM public.ecr.aws/lts/ubuntu:22.04_stable | ||
|
||
RUN apt-get update && apt-get install -y build-essential python3-dev libssl-dev \ | ||
libffi-dev python3-pip python3-venv git | ||
|
||
# DEBUG | ||
RUN apt-get install -y psmisc vim lsof nmap iputils-ping curl | ||
# DEBUG | ||
|
||
RUN useradd -U -m user | ||
|
||
USER user | ||
WORKDIR /home/user | ||
|
||
EXPOSE 8010 | ||
EXPOSE 9989 | ||
|
||
RUN python3 -m pip install --upgrade pip | ||
RUN python3 -m pip install boto3 botocore | ||
RUN python3 -m pip install git-remote-codecommit | ||
RUN python3 -m pip install 'buildbot[bundle]' | ||
|
||
ENV PATH="/home/user/.local/bin:${PATH}" | ||
|
||
RUN buildbot create-master . | ||
COPY admin.cfg . | ||
COPY envfile . | ||
COPY entry.sh . | ||
RUN mkdir userconfig | ||
RUN chown -R user: userconfiguration/ | ||
COPY user.cfg userconfiguration/ | ||
|
||
ENTRYPOINT [ "./entry.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Setting up: | ||
|
||
* Deploy source bucket and pipeline then use the bucket name below. | ||
|
||
``` | ||
# Zip the needed files. | ||
zip -o config.zip buildspec.yml Dockerfile entry.sh master.cfg | ||
# S3 CP to the config key. | ||
aws --profile PROFILE s3 cp config.zip s3://BUCKET/config | ||
``` | ||
|
||
Running locally: | ||
``` | ||
docker build -t buildbot:latest . | ||
# Does not include worker port, found in the master.cfg | ||
docker run -p 8010:8010 buildbot:latest | ||
``` | ||
|
||
Development Setup | ||
``` | ||
python3 -m venv venv | ||
. ./venv/bin/activate | ||
pip install -r dev-requirements.txt | ||
``` | ||
|
Oops, something went wrong.