apprunner-roadmap
apprunner-roadmap copied to clipboard
is this project alive?
I'll borrow this thread to share my similar concern/question today.
I'm an independent developer playing with a toy project. Apprunner seems to be what I need, at least based on the documentation and marketing materials. However, I spent a few more hours trying to set it up but hardly moved forward.
- It tells me service creation and update failed but these are the only log I saw. What went wrong?
09-24-2023 02:08:09 PM [AppRunner] Starting source code build.
09-24-2023 02:08:09 PM [AppRunner] Successfully Validate configuration file.
09-24-2023 02:08:08 PM [AppRunner] Reading apprunner.yaml config file.
09-24-2023 02:07:41 PM [AppRunner] Successfully pulled source code.
09-24-2023 02:07:36 PM [AppRunner] Successfully created pipeline for automatic deployments.
09-24-2023 02:06:55 PM [AppRunner] Service status is set to OPERATION_IN_PROGRESS.
-
I don't see the
Go to Environment variables - optional under Service settings
in the AWS Console. As described in the document. https://docs.aws.amazon.com/apprunner/latest/dg/env-variable-manage.html -
There is a red banner at top saying web ACL is missing. But my understanding is that it's optional. Is it required?
I couldn't get a simple nodejs project https://github.com/drschoice/aws-apprunner-demo0 running with the proper ENV VARs during build...
- if I use
apprunner.yaml
version: 1.0
runtime: nodejs16
build:
env:
- name: MYVAR
value: FOO
commands:
pre-build:
- echo "------------------------------------------------pre-build_start--------------------------------------------"
- env
- echo "------------------------------------------------pre-build_end--------------------------------------------
build:
- echo "------------------------------------------------build_start--------------------------------------------"
- env
- npm install
- npm run build
- echo "------------------------------------------------build_end--------------------------------------------"
post-build:
- echo "------------------------------------------------post-build_start--------------------------------------------"
- env
- echo "------------------------------------------------post-build_end--------------------------------------------
run:
command: npm start
network:
port: 3000
env:
- name: MYVAR
- value: FOO
The build process gets called TWICE, once with the proper ENV VARs and the second time without them lol (the env
command step under the build will verify this), which clobbers the first one or loses it, there goes your proper build, I think what's happening, from the logs at least is that app runner is not plumbing the ENV VARs correctly to all the intermediate containers during the build time
- and if i don't use a config yaml file, just use the UI, you can't use pre-build, post-build and the ENV VARs that you set in the UI don't get passed any of the
*build
steps
This is my build script by the way:
It seems we have a couple of separate issues here which I'm glad to help you work through. First things first - for the first post, can you provide the service arn for us to take a look? For the second comment, multiple start commands are not supported but build commands should be. I'd also like the service arn so we can take a closer look.
multiple start commands
I am not using multiple start commands
I'd also like the service arn
i deleted it, now when I try to re-create it fails
arn
arn:aws:apprunner:us-east-1:979199114165:service/aws-demo0/228c56f89db445dcbe7d56d39012e2a6
EDIT: finally got it to deploy, don't ask me how.
@jsheld notice how the build command was called twice, the first time with the proper BUILD ENV VARs, the 2nd time without them, look for MYVAR
in the logs txt file attached, or highlighted in the screenshot as well.
deployment_ca0e8bfdb49243ea9106f77c9fd9581c.txt
YAML
version: 1.0
runtime: nodejs16
build:
commands:
build:
- echo "------------------------------------------------build_start--------------------------------------------"
- npm install
- npm run build
- echo "------------------------------------------------build_done--------------------------------------------"
env:
- name: MYVAR
value: FOO
run:
command: npm run start
network:
port: 3000
env: PORT
env:
- name: MYVAR
value: FOO
@jsheld
Ok so, what's happening is
- pre-build <-- with ENV VARs
- build <-- with ENV VARs
- post-build <-- with ENV VARs
- build <-- again! why?? and this time without the ENV VARs
See the logs below for apprunner.yaml
https://github.com/drschoice/aws-apprunner-demo0/blob/6d501a843f3280a80ee27b2a3c1529e4b2021b49/apprunner.yaml
deployment_2b6be6b65c9148b59e94adaca324fef2.json.txt
I will leave this sample app running for 1 week, then I will delete it, arn:aws:apprunner:us-east-1:979199114165:service/aws-demo0/228c56f89db445dcbe7d56d39012e2a6
unless I can just pause and can you still investigate
This is still an issue I am running into with my project. I am currently getting around it by setting my NodeJS ENV variables before the build
command that needs them. Is this being worked on at all?
build:
commands:
pre-build:
- npm install
build:
- MY_ENV_VAR='foo' npm run build
# env:
# This doesn't seem to work correctly?
# https://github.com/aws/apprunner-roadmap/issues/212
# - name: MY_ENV_VAR
# value: 'foo'
@zjkipping this is very risky for sensitive secrets, I don't want to add them to my code repo
@akhoury Yep, that is entirely fair and a fairly bad limitation of this service. Thankfully I don't have any secrets I need to pass into my build scripts currently. Just plain text environment variables that can be committed.