rails-lambda / lamby

šŸ‘šŸ›¤ Simple Rails & AWS Lambda Integration
https://lamby.cloud
MIT License
602 stars 29 forks source link

Support for AWS CodePipeline #100

Closed aponcz closed 2 years ago

aponcz commented 3 years ago

How would one go about getting Lamby working with AWS Code Pipeline, more specifically CodeBuild. I'm encountering the following error:

Creating network "src_default" with the default driver
--
75 | Building socket
76 | Step 1/8 : FROM amazon/aws-sam-cli-build-image-ruby2.7
77 | latest: Pulling from amazon/aws-sam-cli-build-image-ruby2.7
78 | Digest: sha256:ad2f34851f004b92448cf4334fe2d312960f52e17cbc32231292b0e915ae979f
79 | Status: Downloaded newer image for amazon/aws-sam-cli-build-image-ruby2.7:latest
80 | ---> eb23e25775d9
81 | Step 2/8 : ARG HOST_UID
82 | ---> Running in 15ff0f44dc96
83 | Removing intermediate container 15ff0f44dc96
84 | ---> c98987b652a5
85 | Step 3/8 : ARG HOST_GID
86 | ---> Running in a3cf2b67181e
87 | Removing intermediate container a3cf2b67181e
88 | ---> 07a25f6f9cfd
89 | Step 4/8 : RUN mkdir /lamby     && /usr/sbin/groupadd --gid $HOST_GID --system --force lamby     && /usr/sbin/useradd --uid $HOST_UID --gid $HOST_GID --non-unique --home-dir /lamby --shell /bin/bash --system lamby     && chown $HOST_UID:$HOST_GID /lamby
90 | ---> Running in d9e9fe139f10
91 | groupadd: invalid group ID '--system'
92 | Service 'socket' failed to build: The command '/bin/sh -c mkdir /lamby     && /usr/sbin/groupadd --gid $HOST_GID --system --force lamby     && /usr/sbin/useradd --uid $HOST_UID --gid $HOST_GID --non-unique --home-dir /lamby --shell /bin/bash --system lamby     && chown $HOST_UID:$HOST_GID /lamby' returned a non-zero code: 3
93 |  
94 | [Container] 2021/05/26 22:52:14 Command did not exit successfully ./bin/setup exit status 1
95 | [Container] 2021/05/26 22:52:14 Phase complete: BUILD State: FAILED
metaskills commented 3 years ago

Please see here and let me know if you still have questions. https://github.com/customink/lamby/issues/94#issuecomment-847994877

metaskills commented 3 years ago

Or better yet, this one https://github.com/customink/lamby/issues/95

metaskills commented 3 years ago

Gonna close this hoping the links above are the answers. If not, lemme know.

aponcz commented 3 years ago

Thanks @metaskills - I managed to get this working in CodeBuild. Here are the updates that needed to be made:

Dockerfile-build

ENV HOST_GID=0
ENV HOST_UID=0

buildspec.yml

version: 0.2

phases:
  build:
    commands:
      - ./bin/setup
      - ./bin/deploy
metaskills commented 3 years ago

Oh, that is interesting. Re-opened. I would have expected Linux to work as is based on this work. https://github.com/customink/lamby-cookiecutter/pull/11/files

metaskills commented 3 years ago

Related on the CodeDeploy side when using a linear DeploymentPreference https://github.com/aws/aws-sam-cli/issues/2761

metaskills commented 2 years ago

Not going to worry about CodePipeline. Ping me if you want to contribute here.