Skip to content
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

feat: dynamicvirtualenv image #2218

Open
wants to merge 4 commits into
base: trunk
Choose a base branch
from
Open

feat: dynamicvirtualenv image #2218

wants to merge 4 commits into from

Conversation

XavierChanth
Copy link
Member

@XavierChanth XavierChanth commented Feb 12, 2025

- What I did

Why: I need hundreds of atServers that can be setup portably for a demo.

Created a version of virtualenv called dynamicvirtualenv that allows you to mount a config file for the atServers.

The file needs to be mounted at /mnt/setup/atservers.
example file format:

@alice 25000 <cramkey>
@bob   25001 <cramkey>

The other main difference to this image is that I've removed the pkamLoad service and the install_PKAM_keys binary since that depends on demo data. All of the pkam keys must be manually setup, but can be easily automated in a simple script (which I plan to develop as part of my demo first).

- How I did it

- How to verify it

- Description for the changelog
feat: dynamicvirtualenv image

Comment on lines +57 to +63
# dynamic ve
cp cert.pem ../../tools/build_virtual_environment/dynamic_ve_base/contents/atsign/root/certs/cert.pem
cp privkey.pem ../../tools/build_virtual_environment/dynamic_ve_base/contents/atsign/root/certs/privkey.pem
cp fullchain.pem ../../tools/build_virtual_environment/dynamic_ve_base/contents/atsign/root/certs/fullchain.pem
cp ../../tools/build_virtual_environment/dynamic_ve_base/contents/atsign/root/certs/*.pem \
../../tools/build_virtual_environment/dynamic_ve_base/contents/atsign/secondary/base/certs/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also add vip.ve.atsign.zone certs to dynamic_ve image

Comment on lines +13 to +19
strategy:
matrix:
include:
- dir: "ve_base"
name: "vebase"
- dir: "dynamic_ve_base"
name: "dynamicvebase"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a matrix for ve_base on scheduled workflow

@@ -0,0 +1,108 @@
name: dynamic_vip_rebuild
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

separate dynamic vip build because this one is workflow dispatch, so we don't want it to be a matrix with vip_rebuild.

Comment on lines 6 to 9
while read -r line; do
echo "line: $line"
./createConf $line # intentional word splitting
done <"$config_file"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of making several inline calls to ./createConf, we read the mounted config file and call createConf for each one.

@XavierChanth
Copy link
Member Author

XavierChanth commented Feb 12, 2025

Other than the removed files that are specific to the demo data, if there isn't a comment on the file changes tab, then I've not changed anything (it's a direct copy of the original ve). The only exception is an update to some comments in the Dockerfiles in ea51a93

Edit to this comment, see: #2218 (comment)

@XavierChanth
Copy link
Member Author

Setting to draft, needs more work

@XavierChanth XavierChanth marked this pull request as draft February 12, 2025 21:21
@XavierChanth
Copy link
Member Author

More changes introduced 97c8e62

To fix the lifecycle of setting up the atServers, which can no longer be done during build time, but must be done before starting supervisord.

@XavierChanth XavierChanth marked this pull request as ready for review February 12, 2025 22:34
@@ -0,0 +1,11 @@
FROM atsigncompany/dynamicvirtualenv:canary
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we expect to have canaries for this, or has this just been copied over?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copied over, I can remove it

@@ -0,0 +1,32 @@
FROM dart:3.6.1@sha256:a071f0322c7c80469842f7c8258de51d1946ba9b79d09bb8fc4dc969487a68ca AS buildimage
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to update hash, but also need to add this Dockerfile to Dependabot config

dart pub update ; \
dart compile exe bin/main.dart -o root ;
# Disabled for dynamic_ve_base
# cd /app/tools/build_virtual_environment/install_PKAM_Keys ; \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we avoid a lot of duplication by having a Dockerfile like this as the new VE base (for both variants) and then have another base image that we build on top of that with this stuff as an extra layer?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I can do that. I've put this PR as an item in the next sprint for me to make these changes. For now, this is enough to continue onwards with the demo I'm working on.

@XavierChanth XavierChanth self-assigned this Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants