-
Notifications
You must be signed in to change notification settings - Fork 3
Add debugging setup & re-add release optimizations #12
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
Conversation
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.
I added ARM build support and basic instructions.
It Simplifies development a lot and optimizes the production build 👍
@@ -20,6 +20,8 @@ jobs: | |||
go-version: '~1.18.2' | |||
|
|||
- name: Build | |||
env: | |||
RELEASE_BUILD_LINKER_FLAGS: "-s -w" |
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.
nice to optimize the production version 👍
LAMBDA_INIT_DELVE_PORT="${LAMBDA_INIT_DELVE_PORT:-40000}" | ||
|
||
# Run init without delve debugger | ||
#exec /var/rapid/init |
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.
I find it useful to have a non-debug entrypoint at hand.
We could even make this configurable through a custom environment variable in the future.
custom-tests/README.md
Outdated
## Debugging with LocalStack |
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.
I added some basic docs
custom-tests/Makefile
Outdated
docker run --rm -v $$(pwd)/build-delve/:/app/ $(DOCKER_GOLANG_IMAGE) \ | ||
bash -c "cd /app && export GOARCH=$(GOARCH) && ./build.sh" | ||
|
||
clean clean-init: clean-rapid clean-delve |
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.
I added cleanup because unless we encode the architecture in the delve build, this is frequently required when switching architectures.
custom-tests/Makefile
Outdated
# On ARM hosts, use: make ARCH=arm64 build-init | ||
# Check host architecture: uname -m | ||
# x86_64 or arm64 | ||
ARCH ?= x86_64 |
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.
Added an architecture flag
Should we make the RIE log level configurable through LocalStack ( Going forward, we could then use info (or even warn) to reduce default log verbosity. |
@joe4dev Yeah that was the intention, but I didn't follow-up on that thought yet since I probably first want to rework the logging a bit in the init. For now it's probably best we just remove it from the config |
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.
LGTM! My only minor nit is the custom-tests
folder, I find the naming confusing, as I do not get the connection between custom-tests
and adding a debugger.
custom-tests/Makefile
Outdated
build: | ||
docker build -t rapid-debug . | ||
# Golang EOL overview: https://endoflife.date/go | ||
DOCKER_GOLANG_IMAGE ?= golang:1.18.2 |
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.
We might want to update this at least to 1.18.10, don't you think? We also might want to rebase localstack
update localstack to upstream, as they have some dependency updates as well.
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.
let's do this separately though 😁
We'll iterate over a few init releases anyway in the coming days/weeks
Yeah that one existed for a while now (also with a quite unclear purpose so far), but we can rename this now 👍 |
You can now run:
which will build the necessary files under
debugging/init/var/rapid/
for mounting into localstack when debugging.