Giter Club home page Giter Club logo

aws-codebuild-user-guide's Introduction

aws-codebuild-user-guide's People

Contributors

0xdones avatar adamdama avatar adrianp873 avatar anibalsanchez avatar bengalbrony avatar brdly-smith avatar clasyc avatar dscpinheiro avatar eaganvp avatar fbouteruche avatar glnds avatar gruebel avatar hanusri avatar huanjani avatar jburdon avatar joe-niland avatar joebowbeer avatar joshbean avatar jpeddicord avatar jumbosushi avatar kichik avatar l0s avatar linchiwei123 avatar linghaoz avatar markiver avatar neurostream avatar pupupopo88 avatar sharmus avatar strohm-a avatar subinataws avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aws-codebuild-user-guide's Issues

Custom docker image doesn't work as expected on codebuild

Documentation:

Docker in custom image sample for CodeBuild
https://github.com/awsdocs/aws-codebuild-user-guide/blob/main/doc_source/sample-docker-custom-image.md

Issue

Unable to successfully start docker in code build with either a custom image or the Amazon Linux codebuild image aws/codebuild/amazonlinux2-x86_64-standard:3.0 using the buildspec.yaml example

phases: 
  install:
    commands: 
      - nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay2&
      - timeout 15 sh -c "until docker info; do echo .; sleep 1; 

i receive the following error from the docker daemon in the codebuild logs

time="2021-01-18T04:27:50.504883817Z" level=error msg="failed to mount overlay: operation not permitted" storage-driver=overlay2
time="2021-01-18T04:27:50.505235383Z" level=info msg="stopping healthcheck following graceful shutdown" module=libcontainerd
time="2021-01-18T04:27:50.505249916Z" level=info msg="stopping event stream following graceful shutdown" error="context canceled" module=libcontainerd namespace=plugins.moby
failed to start daemon: error initializing graphdriver: driver not supported

i tried removing --storage-driver=overlay2 from the command which threw the following error

failed to start daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain DOCKER: iptables failed: iptables -t nat -N DOCKER: iptables v1.8.2 (legacy): can't initialize iptables table `nat': Permission denied (you must be root)

Just wondering if there is an updated way to run docker in codebuild?

Error: Could not find a schema

am using the amplify console which i believe uses codebuild. I get the following error which I have no clue on where to go to deal with.

                            # Starting phase: build
                             # Executing command: amplifyPush --simple

2019-06-13T03:19:08.118Z [INFO]: # Getting Amplify CLI Cloud-Formation stack info from environment cache
2019-06-13T03:19:08.124Z [INFO]: # Start initializing Amplify environment: prod
# Initializing new Amplify environment: prod (amplify init)
2019-06-13T03:19:12.022Z [INFO]: Note: It is recommended to run this command from the root of your app directory
2019-06-13T03:19:12.800Z [INFO]:
2019-06-13T03:19:12.800Z [INFO]: For more information on AWS Profiles, see:
https://docs.aws.amazon.com/cli/latest/userguide/cli-multiple-profiles.html
2019-06-13T03:19:12.868Z [WARNING]: - Initializing your environment: prod
2019-06-13T03:19:13.294Z [WARNING]: ✔ Initialized provider successfully.
019-06-13T03:19:05.065Z [INFO]: Git SSH Key acquired
2019-06-13T03:19:05.170Z [INFO]: Cloning repository: [email protected]:katenelson42/onlinecoop.git
2019-06-13T03:19:05.294Z [INFO]: Agent pid 67
2019-06-13T03:19:05.299Z [WARNING]: Identity added: /root/.ssh/git_rsa (/root/.ssh/git_rsa)
2019-06-13T03:19:05.322Z [WARNING]: Cloning into 'onlinecoop'...
2019-06-13T03:19:05.383Z [WARNING]: Warning: Permanently added the RSA host key for IP address '192.30.255.112' to the list of known hosts.
2019-06-13T03:19:06.190Z [INFO]: Switching to commit: f83bbe61d7cf1843ca5d107457d8d50ec39611ba
2019-06-13T03:19:06.227Z [WARNING]: Note: checking out 'f83bbe61d7cf1843ca5d107457d8d50ec39611ba'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b
HEAD is now at f83bbe6... Switched graphql back to cognito
2019-06-13T03:19:06.227Z [INFO]: Checking for Git submodules at: /codebuild/output/src082925135/src/onlinecoop/.gitmodules
2019-06-13T03:19:06.258Z [INFO]: Retrieving cache...
2019-06-13T03:19:06.302Z [INFO]: Extracting cache...
2019-06-13T03:19:06.415Z [INFO]: Extraction done...
2019-06-13T03:19:06.416Z [INFO]: Retrieving environment cache...
# Starting phase: build
# Executing command: amplifyPush --simple
2019-06-13T03:19:08.118Z [INFO]: # Getting Amplify CLI Cloud-Formation stack info from environment cache
2019-06-13T03:19:08.124Z [INFO]: # Start initializing Amplify environment: prod
# Initializing new Amplify environment: prod (amplify init)
2019-06-13T03:19:12.022Z [INFO]: Note: It is recommended to run this command from the root of your app directory
2019-06-13T03:19:12.800Z [INFO]:
2019-06-13T03:19:12.800Z [INFO]: For more information on AWS Profiles, see:
https://docs.aws.amazon.com/cli/latest/userguide/cli-multiple-profiles.html
2019-06-13T03:19:12.868Z [WARNING]: - Initializing your environment: prod
2019-06-13T03:19:13.294Z [WARNING]: ✔ Initialized provider successfully.
2019-06-13T03:19:13.449Z [WARNING]: ✖ An error occurred when pushing the resources to the cloud
2019-06-13T03:19:13.449Z [WARNING]: ✖ There was an error initializing your environment.
2019-06-13T03:19:13.449Z [INFO]: init failed
2019-06-13T03:19:13.474Z [INFO]: Error: Could not find a schema at /codebuild/output/src082925135/src/onlinecoop/amplify/backend/api/mfcPosApi/schema.graphql
at /home/circleci/repo/packages/graphql-transformer-core/src/util/amplifyUtils.ts:207:15
at step (/root/.nvm/versions/node/v8.12.0/lib/node_modules/@aws-amplify/cli/node_modules/graphql-transformer-core/lib/util/amplifyUtils.js:40:23)
at Object.next (/root/.nvm/versions/node/v8.12.0/lib/node_modules/@aws-amplify/cli/node_modules/graphql-transformer-core/lib/util/amplifyUtils.js:21:53)
at fulfilled (/root/.nvm/versions/node/v8.12.0/lib/node_modules/@aws-amplify/cli/node_modules/graphql-transformer-core/lib/util/amplifyUtils.js:12:58)
at
2019-06-13T03:19:13.482Z [ERROR]: !!! Build failed
2019-06-13T03:19:13.482Z [ERROR]: !!! Non-Zero Exit Code detected
2019-06-13T03:19:13.482Z [INFO]: # Starting environment caching...
2019-06-13T03:19:13.483Z [INFO]: # Environment caching completed
Terminating logging...

Perplexing statement about ID format

The text says to use alphanumeric and underscores, but the example uses a hyphen. Which is it?

For Identifier, enter a unique file system identifier. It must be fewer than 129 characters and contain only alphanumeric characters and underscores. CodeBuild uses this identifier to create an environment variable that identifies the elastic file system. The environment variable format is CODEBUILD_file-system-identifier in capital letters. For example, if you enter efs-1, the environment variable is CODEBUILD_EFS-1.

Feature request: Support for Hashicorp Terraform as a new runtime type

Would like to see Terraform supported as a CodeBuild Runtime option. Should be pretty easy, it's a single executable approx. 60MB in size, and the download URL can be interpolated directly from the semver.

Current workaround is to cache the executable manually using CodeBuild buildspec commands (typically in the Install phase).

env variable composition is not supported

Given:

version: 0.2
run-as: root
env:
    variables:
        "CONTAINER_NAME": "umccrise"
        "CONTAINER_REPO_NAME": "$CONTAINER_NAME"
        "CONTAINER_REPO_URL": "SOMEID.dkr.ecr.ap-southeast-2.amazonaws.com/$CONTAINER_REPO_NAME"

The expansion for $CONTAINER_REPO_URL on runtime is wrong (by bash/reasonable standards):

[Container] 2020/03/05 01:27:54 Running command echo $CONTAINER_REPO_URL/$CONTAINER_NAME
SOMEID.dkr.ecr.ap-southeast-2.amazonaws.com/$CONTAINER_REPO_NAME/umccrise

IMHO, it should really expand the imbricated en vars recursively:

[Container] 2020/03/05 01:27:54 Running command echo $CONTAINER_REPO_URL/$CONTAINER_NAME
SOMEID.dkr.ecr.ap-southeast-2.amazonaws.com/umccrise/umccrise

Shall I do a pull request to clarify this bit? I lost a bit of time figuring this non-intuitive CodeBuild behaviour.

/cc @reisingerf @victorskl @vladsaveliev

Add NO_SOURCE to source-type list

In the list of source-types (and secondary source-types) in the doc_source/create-project.md file it does not list NO_SOURCE which can be used with the BuildSpec value to use a file that is not managed by an external source.

[Bug?] CodeBuild EventBridge Notification is coming different than referred in docs

I subscribed a lambda function to EventBridge CodeBuild Events, but when I log it to CloudWatch looks like some fields are coming with a different format from the docs, for example, every field that contains two colons are coming with a single colon and a space, like this:

Expected:

  • build-id: "arn:aws:codebuild:us-east-1::<Account>:build/node-http-server-example-codebuild-build:af8ff896-6f56-4bea-a7ee-f1b1f446eda8"
  • source.location "https://github.com/(...).git"

Received:

  • build-id: "arn:aws:codebuild:us-east-1: <Account>:build/node-http-server-example-codebuild-build:af8ff896-6f56-4bea-a7ee-f1b1f446eda8"
  • source.location "https: //github.com/(...).git"

Reports are failing with latest version of cucumber-js

I don't know where to submit an issue for codebuild test reporting tools. Sorry if this is a wrong place 😨

A user of cucumber reported an issue with the latest version of cucumber-js: the codebuild report is failing with the following error message:

Error in UPLOAD_ARTIFACTS phase: [system: [error processing report: [/codebuild/output/src381885655/src/reports/system/cucumber.json: json: cannot unmarshal number 253118.99999999997 into Go struct field Result.elements.steps.result.duration of type time.Duration]]]

Indeed, in recent version of cucumber-js, the precision of duration has been increased

Here's the slack thread where it happened: https://cucumberbdd.slack.com/archives/C6QJ6N695/p1651483291178619

Using Ubuntu with Sample Docker Custom Image will fail

Issue description

The documentation sample-docker-custom-image.md is describing what needs to be done in CodeBuild when using a custom image to start Docker in the buildspec.yml:

phases:
  install:
    commands:
      - nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay&
      - timeout -t 15 sh -c "until docker info; do echo .; sleep 1; done"

This is only working if you are using alpine, but not for example for Ubuntu.

As my custom image for CodeBuild is based on Ubuntu, I can't use this snippet without a modification like this (remove the -t from timeout):

      - timeout 15 sh -c "until docker info; do echo .; sleep 1; done"

I would like to update documentation to also add an example for Ubuntu. Are you fine with this? Or how should this be addressed?

Steps to reproduce

  • Open the documentation
  • Create a custom Docker Image for CodeBuild using Ubuntu
  • Use the provided command to start Docker

Wrong SHA signature for the CodeBuild agent

Both SHA signatures for the x86_64 and ARM versions of the CodeBuild agent are wrong. They may be just outdated.

Duplicate of #59

1. Download the agent\.
To download the x86\_64 version of the agent, run the following command:
```
$ docker pull public.ecr.aws/codebuild/local-builds:latest
```
To download the ARM version of the agent, run the following command:
```
$ docker pull public.ecr.aws/codebuild/local-builds:aarch64
```
1. <a name="codebuild-agent-sha"></a>The CodeBuild agent is available from [https://gallery\.ecr\.aws/codebuild/local\-builds](https://gallery.ecr.aws/codebuild/local-builds)\.
The Secure Hash Algorithm \(SHA\) signature for the x86\_64 version of the agent is:
```
sha256:fdfff9470520c53dcd522606a3cc2b5df195ae8a5546697b08249b48175f45ed
```
The SHA signature for the ARM version of the agent is:
```
sha256:5480b70cf48435e276c21789c61280cfada24e17701ede6386e5d82088bc41ca
```
You can use the SHA to identify the version of the agent\. To see the agent's SHA signature, run the following command and look for the SHA under `RepoDigests`:
```
$ docker inspect public.ecr.aws/codebuild/local-builds:latest
```

$ docker pull public.ecr.aws/codebuild/local-builds:latest                            
latest: Pulling from codebuild/local-builds
Digest: sha256:6d4aca40229b0e21232198016e82b3d0e2027fb8ee639276b6d64ff995065f0c
Status: Image is up to date for public.ecr.aws/codebuild/local-builds:latest
public.ecr.aws/codebuild/local-builds:latest
$ docker pull public.ecr.aws/codebuild/local-builds:aarch64
aarch64: Pulling from codebuild/local-builds
Digest: sha256:3fb32e40b65d38a1ea800bf05eba0bf05b36c954d9cd72fa008c74aaf2fb6577
Status: Image is up to date for public.ecr.aws/codebuild/local-builds:aarch64
public.ecr.aws/codebuild/local-builds:aarch64
$ docker inspect public.ecr.aws/codebuild/local-builds:latest | grep RepoDigests -A 2 
        "RepoDigests": [
            "public.ecr.aws/codebuild/local-builds@sha256:6d4aca40229b0e21232198016e82b3d0e2027fb8ee639276b6d64ff995065f0c"
        ],
$ docker inspect public.ecr.aws/codebuild/local-builds:aarch64 | grep RepoDigests -A 2
        "RepoDigests": [
            "public.ecr.aws/codebuild/local-builds@sha256:3fb32e40b65d38a1ea800bf05eba0bf05b36c954d9cd72fa008c74aaf2fb6577"
        ],

Branch filter is not mentioned on the documentation

The functionality of specifying a Branch filter for GitHub/GHE does not appear to be present in the documentation. It would be nice to have that functionality references there, eventually with some examples.

Relevant Environment Variables not mentioned

https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html

In this page, there is a list of environment variables in build environments but when I tried to use printenv in my build container I saw there were many other relevant environment variables which are not mentioned which could be really useful to the use in making their builds and code pipeline dynamic.

I would like to send a PR depending after discussing with team which variables ( relevant ) can be added to the list.

Incorrect documentation for batch/build-graph

It seems fc471ad introduced some issues in the documentation for batch/build-graph in doc_source/batch-build-buildspec.md

Basically it contains duplicated documentation for batch/build-graph/static/env/type and batch/build-graph/static/env/privileged-mode.
It also documents that image, compute-type and variables can be configured through batch/build-graph/static/env - something that does not seem to work at all.

Old version of configuration documents image, compute-type and variables as only configurable under batch/build-graph/dynamic/env - which is the only way I've managed to get the configuration to work.

Sample for specifying multiple versions of the same runtime in CodeBuild

Is your feature request related to a problem? Please describe.

Describe the solution you'd like
Need sample for specifying multiple versions of the same runtime in CodeBuild, if the support exists

Describe alternatives you've considered
Continue using TravisCI for running on multiple versions of same runtime and CodeBuild for latest LTS version of the runtime

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.