Skip to content

Commit d4ba369

Browse files
authored
Merge pull request #7 from aws4embeddedlinux/2023-11-22_doc
README.md: add description how to deploy specific examples
2 parents ce1225e + 221d8ce commit d4ba369

File tree

2 files changed

+46
-20
lines changed

2 files changed

+46
-20
lines changed

README.md

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Getting Started
44
This repository shows ways to use the [aws4embeddedlinux-ci](https://github.com/aws4embeddedlinux/aws4embeddedlinux-ci.git) library.
55

6-
In order to use these examples, you must set up the [CDK](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html), including
6+
In order to use these examples, you must set up the [CDK](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html), including
77
installing the CDK tool and bootstrapping the account you wish to deploy to. Additionally, you must have [Node](https://nodejs.org/en/) installed.
88

99
### Clone and Setup NPM Project
@@ -14,7 +14,7 @@ npm install .
1414
npm run build
1515
```
1616

17-
Note that while the CDK projects often do not require that you invoke the build command separately, doing so will ensure various assets
17+
Note that while the CDK projects often do not require that you invoke the build command separately, doing so will ensure various assets
1818
in the library are packaged correctly.
1919

2020
### Deploying
@@ -25,12 +25,21 @@ To deploy _all_ the pipeline examples, you can use the CDK deploy command:
2525
cdk deploy --all
2626
```
2727

28-
The pipelines can be found in the `Developer Tools > Code Pipeline > Pipelines` Console page. The newly created
29-
pipeline `ubuntu_22_04BuildImagePipeline` should start automatically. If not, it will need to be run before other
28+
Alternatively to deploy just a specific pipeline example, you can use the CDK deploy command:
29+
30+
EXAMPLE can be one or more of those: PokyPipeline, QemuEmbeddedLinuxPipeline, PokyAmiPipeline, KasPipeline, RenesasPipeline, NxpImxPipeline
31+
32+
```bash
33+
cdk deploy <EXAMPLE>
34+
```
35+
36+
The pipelines can be found in the `Developer Tools > Code Pipeline > Pipelines` Console page. The newly created
37+
pipeline `ubuntu_22_04BuildImagePipeline` should start automatically. If not, it will need to be run before other
3038
pipelines will work correctly. Once it is complete, the EmbeddedLinuxPipeline in the CodePipeline console page is ready to run.
3139

3240
### Removing Pipelines
3341
The `cdk destroy` command can be used to remove individual pipelines and their related resources. This can also be done in the CloudFormation Console Page.
42+
**Do not delete stacks while a CodePipeline is running, this can lead to unexpected failures!**
3443

3544
To remove all the resources associated with this application:
3645
```bash
@@ -43,31 +52,37 @@ Several example pipelines are provided. Each one demonstrates a different aspect
4352
### A Simple Poky Based Pipeline
4453
This example will build the `core-image-minimal` image from Poky using the repo tool to manage layers. CVE checking is also enabled in the buildspec file.
4554

46-
The recommended place to view this is from the `Developer Tools > Code Pipeline > Pipelines` page. The pipeline will start with `PokyPipeline-`
47-
followed by some unique identifier. From the pipeline page, you can find the CodeCommit source repository, the CodeBuild Project (with build logs),
55+
The recommended place to view this is from the `Developer Tools > Code Pipeline > Pipelines` page. The pipeline will start with `PokyPipeline-`
56+
followed by some unique identifier. From the pipeline page, you can find the CodeCommit source repository, the CodeBuild Project (with build logs),
4857
and the S3 bucket that the image is uploaded to, at the end.
4958

59+
Example stack name: PokyPipeline
60+
5061
#### Using Kas
51-
The Kas example shows how to use a [Kas Config](https://github.com/aws4embeddedlinux/aws4embeddedlinux-ci/blob/main/source-repo/kas/kas.yml) to manage
62+
The Kas example shows how to use a [Kas Config](https://github.com/aws4embeddedlinux/aws4embeddedlinux-ci/blob/main/source-repo/kas/kas.yml) to manage
5263
layers. This tool can help programatically manage layers and config with tighter Yocto integration than Git Submodules or the Repo tool.
5364

5465
See the AWS CodeBuild pipeline: KasPipeline-EmbeddedLinuxPipeline*
5566

67+
Example stack name: KasPipeline
68+
5669
#### A slightly modified version building a qemu pipeline:
57-
This example builds a Qemu based image using [meta-aws-demos](https://github.com/aws4embeddedlinux/meta-aws-demos). The Qemu image can be run in
58-
the CodeBuild environment. Using SLIRP networking, [OEQA testing](https://docs.yoctoproject.org/singleindex.html#performing-automated-runtime-testing)
70+
This example builds a Qemu based image using [meta-aws-demos](https://github.com/aws4embeddedlinux/meta-aws-demos). The Qemu image can be run in
71+
the CodeBuild environment. Using SLIRP networking, [OEQA testing](https://docs.yoctoproject.org/singleindex.html#performing-automated-runtime-testing)
5972
such as ptest can be run in the pipeline.
6073

6174
See the AWS CodeBuild pipeline: QemuEmbeddedLinuxPipeline-EmbeddedLinuxPipeline*
6275

6376
### A Poky Based EC2 AMI Pipeline
64-
Yocto can be used to create an EC2 AMI. This example builds an AMI based on Poky and meta-aws and exports it to your AMI registry using
77+
Yocto can be used to create an EC2 AMI. This example builds an AMI based on Poky and meta-aws and exports it to your AMI registry using
6578
the [VM Import/Export Service](https://docs.aws.amazon.com/vm-import/latest/userguide/what-is-vmimport.html).
6679

6780
The pipeline name starts with `PokyAmiPipeline-` in the CodePipeline page.
6881

82+
Example stack name: PokyAmiPipeline
83+
6984
### A NXP / IMX Pipeline
70-
This example will build an image for
85+
This example will build an image for
7186
the [i.MX 6ULL EVK](https://www.nxp.com/design/development-boards/i-mx-evaluation-and-development-boards/evaluation-kit-for-the-i-mx-6ull-and-6ulz-applications-processor:MCIMX6ULL-EVK) board.
7287

7388
Accepting the EULA is required. For this you need to uncomment the
@@ -78,9 +93,11 @@ Accepting the EULA is required. For this you need to uncomment the
7893

7994
The pipeline name starts with `NxpImxPipeline-` in the CodePipeline page.
8095

96+
Example stack name: NxpImxPipeline
97+
8198
### Using pre-built, proprietary artifacts in a Pipeline
8299

83-
This example is based on this [work](https://elinux.org/R-Car/Boards/Yocto-Gen3/v5.9.0) to build an image for Renesas R-Car-H3 Starter Kit
100+
This example is based on this [work](https://elinux.org/R-Car/Boards/Yocto-Gen3/v5.9.0) to build an image for Renesas R-Car-H3 Starter Kit
84101
Premier board (unofficial name - H3ULCB) including the proprietary graphics and multimedia drivers from Renesas.
85102

86103
Download the Multimedia and Graphics library and related Linux drivers from the following link (registration necessary):
@@ -95,12 +112,14 @@ Graphic drivers are required for Wayland. Multimedia drivers are optional.
95112

96113
#### Steps to build the image
97114

98-
1. Create a folder named `proprietary` in the root of the source repo, and put those two downloaded files into this folder.
115+
1. Create a folder named `proprietary` in the root of the source repo, and put those two downloaded files into this folder.
99116
1. Deploy the build pipeline and uncomment the `#TODO` in the build.sh file.
100117
1. A build should automatically start. Once it succeeds you will get an image containing the proprietary graphics and multimedia drivers.
101118

102119
See the AWS CodeBuild pipeline: RenesasPipeline-EmbeddedLinuxPipeline*
103120

121+
Example stack name: RenesasPipeline
122+
104123
---
105124

106125
## Useful NPM and CDK commands

bin/app.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env node
22
import * as cdk from "aws-cdk-lib";
3+
import { addDependency } from "aws-cdk-lib/core/lib/deps";
34
import {
45
EmbeddedLinuxPipelineStack,
56
BuildImageDataStack,
@@ -40,7 +41,7 @@ const buildImageRepo = new BuildImageRepoStack(app, "BuildImageRepo", {
4041
...defaultProps,
4142
});
4243

43-
new BuildImagePipelineStack(app, "BuildImagePipeline", {
44+
const buildImagePipeline = new BuildImagePipelineStack(app, "BuildImagePipeline", {
4445
...defaultProps,
4546
dataBucket: buildImageData.bucket,
4647
repository: buildImageRepo.repository,
@@ -57,69 +58,75 @@ const vpc = new PipelineNetworkStack(app, {
5758
/**
5859
* Create a poky distribution pipeline.
5960
*/
60-
new EmbeddedLinuxPipelineStack(app, "PokyPipeline", {
61+
const pokyPipeline = new EmbeddedLinuxPipelineStack(app, "PokyPipeline", {
6162
...defaultProps,
6263
imageRepo: buildImageRepo.repository,
6364
imageTag: ImageKind.Ubuntu22_04,
6465
vpc: vpc.vpc,
6566
});
67+
pokyPipeline.addDependency(buildImagePipeline)
6668

6769
/**
6870
* Create a meta-aws-demos pipeline for the Qemu example.
6971
*/
70-
new EmbeddedLinuxPipelineStack(app, "QemuEmbeddedLinuxPipeline", {
72+
const qemuEmbeddedLinuxPipeline = new EmbeddedLinuxPipelineStack(app, "QemuEmbeddedLinuxPipeline", {
7173
...defaultProps,
7274
imageRepo: buildImageRepo.repository,
7375
imageTag: ImageKind.Ubuntu22_04,
7476
vpc: vpc.vpc,
7577
layerRepoName: "qemu-demo-layer-repo",
7678
projectKind: ProjectKind.MetaAwsDemo,
7779
});
80+
qemuEmbeddedLinuxPipeline.addDependency(buildImagePipeline)
7881

7982
/**
8083
* Create an AMI based on Poky.
8184
*/
82-
new EmbeddedLinuxPipelineStack(app, "PokyAmiPipeline", {
85+
const pokyAmiPipeline = new EmbeddedLinuxPipelineStack(app, "PokyAmiPipeline", {
8386
...defaultProps,
8487
imageRepo: buildImageRepo.repository,
8588
imageTag: ImageKind.Ubuntu22_04,
8689
vpc: vpc.vpc,
8790
layerRepoName: "ec2-ami-poky-layer-repo",
8891
projectKind: ProjectKind.PokyAmi,
8992
});
93+
pokyAmiPipeline.addDependency(buildImagePipeline)
9094

9195
/**
9296
* Create an kas based image.
9397
*/
94-
new EmbeddedLinuxPipelineStack(app, "KasPipeline", {
98+
const kasPipeline = new EmbeddedLinuxPipelineStack(app, "KasPipeline", {
9599
...defaultProps,
96100
imageRepo: buildImageRepo.repository,
97101
imageTag: ImageKind.Ubuntu22_04,
98102
vpc: vpc.vpc,
99103
layerRepoName: "biga-kas-layer-repo",
100104
projectKind: ProjectKind.Kas,
101105
});
106+
kasPipeline.addDependency(buildImagePipeline)
102107

103108
/**
104109
* Create an renesas image.
105110
*/
106-
new EmbeddedLinuxPipelineStack(app, "RenesasPipeline", {
111+
const renesasPipeline = new EmbeddedLinuxPipelineStack(app, "RenesasPipeline", {
107112
...defaultProps,
108113
imageRepo: buildImageRepo.repository,
109114
imageTag: ImageKind.Ubuntu22_04,
110115
vpc: vpc.vpc,
111116
layerRepoName: "renesas-layer-repo",
112117
projectKind: ProjectKind.Renesas,
113118
});
119+
renesasPipeline.addDependency(buildImagePipeline)
114120

115121
/**
116122
* Create an nxp image.
117123
*/
118-
new EmbeddedLinuxPipelineStack(app, "NxpImxPipeline", {
124+
const nxpImxPipeline = new EmbeddedLinuxPipelineStack(app, "NxpImxPipeline", {
119125
...defaultProps,
120126
imageRepo: buildImageRepo.repository,
121127
imageTag: ImageKind.Ubuntu22_04,
122128
vpc: vpc.vpc,
123129
layerRepoName: "nxp-imx-layer-repo",
124130
projectKind: ProjectKind.NxpImx,
125131
});
132+
nxpImxPipeline.addDependency(buildImagePipeline)

0 commit comments

Comments
 (0)