-
Notifications
You must be signed in to change notification settings - Fork 35
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
fix: Remove build golang lambda #535
base: main
Are you sure you want to change the base?
Changes from all commits
f3f6aa2
f13bbcf
0eff792
96c307b
8fd1025
7b43ef5
a0f0d52
43efd4f
02d7f83
c4531a1
f90e103
7c11e1b
af1c525
c8e6192
bf66e8e
d8438ae
5c63612
13462b1
1939c90
b1b8fc5
8013833
620fb87
20386dc
58a4878
963dedf
1614181
8e62c49
7b80c20
24865dd
e58665a
aee18b7
b6d829c
5d7249c
0f0ff9e
41431b3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"python.analysis.extraPaths": [ | ||
"./lambda" | ||
] | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,19 +14,6 @@ stage. Please use only ^2.0.0. | |
## Features | ||
|
||
- Copy image from ECR/external registry to (another) ECR/external registry | ||
- Copy an archive tarball image from s3 to ECR/external registry | ||
|
||
## Environment variables | ||
|
||
Enable flags: `true`, `1`. e.g. `export CI=1` | ||
|
||
- `CI` indicate if it's CI environment. This flag will enable building lambda from scratch. | ||
- `NO_PREBUILT_LAMBDA` disable using prebuilt lambda. | ||
- `FORCE_PREBUILT_LAMBDA` force using prebuilt lambda. | ||
|
||
⚠️ If you want to force using prebuilt lambda in CI environment to reduce build time. Try `export FORCE_PREBUILT_LAMBDA=1`. | ||
|
||
⚠️ The above flags are only available in cdk-ecr-deployment 2.x and 3.x. | ||
|
||
## Examples | ||
|
||
|
@@ -52,9 +39,9 @@ new ecrdeploy.ECRDeployment(this, 'DeployDockerImage2', { | |
// Copy from private docker registry to ECR. | ||
// The format of secret in aws secrets manager must be plain text! e.g. <username>:<password> | ||
new ecrdeploy.ECRDeployment(this, 'DeployDockerImage3', { | ||
src: new ecrdeploy.DockerImageName('javacs3/nginx:latest', 'username:password'), | ||
// src: new ecrdeploy.DockerImageName('javacs3/nginx:latest', 'aws-secrets-manager-secret-name'), | ||
// src: new ecrdeploy.DockerImageName('javacs3/nginx:latest', 'arn:aws:secretsmanager:us-west-2:000000000000:secret:id'), | ||
src: new ecrdeploy.DockerImageName('your-private-docker-registry/nginx:latest', 'username:password'), | ||
// src: new ecrdeploy.DockerImageName('your-private-docker-registry/nginx:latest', 'aws-secrets-manager-secret-name'), | ||
// src: new ecrdeploy.DockerImageName('your-private-docker-registry/nginx:latest', 'arn:aws:secretsmanager:us-west-2:000000000000:secret:id'), | ||
dest: new ecrdeploy.DockerImageName(`${cdk.Aws.ACCOUNT_ID}.dkr.ecr.us-west-2.amazonaws.com/my-nginx3:latest`), | ||
}).addToPrincipalPolicy(new iam.PolicyStatement({ | ||
effect: iam.Effect.ALLOW, | ||
|
@@ -68,17 +55,19 @@ new ecrdeploy.ECRDeployment(this, 'DeployDockerImage3', { | |
## Sample: [test/example.ecr-deployment.ts](./test/example.ecr-deployment.ts) | ||
|
||
```shell | ||
# Generate crane lambda layer firstly. | ||
./layer/build.sh | ||
|
||
# Run the following command to try the sample. | ||
NO_PREBUILT_LAMBDA=1 npx cdk deploy -a "npx ts-node -P tsconfig.dev.json --prefer-ts-exts test/example.ecr-deployment.ts" | ||
npx cdk deploy -a "npx ts-node -P tsconfig.dev.json --prefer-ts-exts test/example.ecr-deployment.ts" | ||
|
||
# To run python unit test. | ||
pytest -c lambda/pyproject.toml | ||
|
||
``` | ||
|
||
## [API](./API.md) | ||
|
||
## Tech Details & Contribution | ||
|
||
The core of this project relies on [containers/image](https://github.com/containers/image) which is used by [Skopeo](https://github.com/containers/skopeo). | ||
Please take a look at those projects before contribution. | ||
|
||
To support a new docker image source(like docker tarball in s3), you need to implement [image transport interface](https://github.com/containers/image/blob/master/types/types.go). You could take a look at [docker-archive](https://github.com/containers/image/blob/ccb87a8d0f45cf28846e307eb0ec2b9d38a458c2/docker/archive/transport.go) transport for a good start. | ||
|
||
To test the `lambda` folder, `make test`. | ||
The underlying implementation depends on the https://github.com/google/go-containerregistry. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does this mean? |
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section needs some clarification that these instructions only apply if you're developing on the repository, not if you're a user of the construct.
README.md
is typically consumer-targeted, and the section title says "Sample", so it should (mostly) only contain instructions for consumers.These instructions would make more sense in
CONTRIBUTING.md
in a section title "How to run tests".If you want to keep them here, clearly label the instructions as intended for developers, not for consumers.