-
Notifications
You must be signed in to change notification settings - Fork 4
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
Sage 1382 docker compose vm #23
base: main
Are you sure you want to change the base?
Conversation
Adds override values for virtual node repo and instructions in README.
The multiple docker-compose file pattern seems fine and would be easy to extend. (I used something similar for virtual waggle in the past.) Not sure how soon you'd want this, but if you want to support multiple nodes, you could write a tiny generator which takes a list like:
and emits a
|
build: | ||
context: node-platforms/vm | ||
dockerfile: Dockerfile | ||
args: |
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 think you probably want to use ${VSN}
and ${NODE_ID}
instead?
You were trying to use the default env vars defined in the .env file, right?
(This will still work, but just use VSN and NODE_ID as the VSN and node ID. 😀)
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.
Yes, just use the .env var at build time.
This is seperate from having multiple nodes. This was more about using this pattern for integration steps. For example when we want to test with beehive.
I did not want to go that route since I am only going to test at most two locally. If I want to go more than 2, I will start testing in kubernetes.
The way I demoed it when you were gone was to use the scale option in docker-compose. This will be done after I adjust the values in the .env file (VSN and NODE_ID).
docker-compose -f docker-compose.yml -f docker-compose.vm.yml up --build --scale node1=2 -d
This will generate node1_1
and node1_2
It does overwrite the values from node1_1
but since it already registered with beekeeper the db has the previous node id before I modified it.
SAGE-1382 aims to figure out the ssh keys so that it works for multiple nodes so that's why I did not add the scale stuff to this PR. I might have to add something similar to what you are proposing in docker-compose.nodes.yaml
if the nodeid is being checked.
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.
Alright the PR is ready. Fix all the problems and now works. Added your suggestions.
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.
Need to add another workflow to run the unit-test for the docker-compose overlay.
Change iperezx/node-platforms to waggle-sensor/node-platforms in README.
- Change build args for VSN and NODE_ID to values in the overlay file - Add node2
fix the name of the image so it doesnt overwrite the image for the other vm node
I think this is a good pattern for adding different integrations to beekeeper and all the different test environments we have.