-
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
Open
iperezx
wants to merge
6
commits into
main
Choose a base branch
from
SAGE-1382-docker-compose-vm
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ea514fe
Update README.md to remove "SAGE
jswantek 0408c44
SAGE-1385: docker-compose dev environment for virtual node
iperezx 0016a2f
Merge branch 'main' into SAGE-1382-docker-compose-vm
iperezx 47304dc
SAGE-1385: docker-compose dev environment for virtual node
iperezx 76c4d46
SAGE-1385: docker-compose dev environment for virtual node
iperezx 409ed58
SAGE-1385: docker-compose dev environment for virtual node
iperezx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,13 +12,35 @@ communication keys used by the nodes (i.e. services running on them) | |
|
||
## start beekeeper | ||
|
||
The docker-compose file has override values for different local dev environments. | ||
|
||
Here is a list of files: | ||
1. `docker-compose.vm.yml`: overrides node1 service with a vm cloned repo (manually by the user). | ||
|
||
Setup for each override docker-compose `.yml` file (same enumeration as above): | ||
1. Setup | ||
``` | ||
git clone [email protected]:waggle-sensor/node-platforms.git | ||
``` | ||
|
||
Generate keys: | ||
```bash | ||
./create-keys.sh init --nopassword | ||
./create-keys.sh cert untilforever forever | ||
docker-compose up --build | ||
``` | ||
Note: Options above like `--nopassword` and `forever` should not be used in production. | ||
|
||
Start beekeeper with no overriden values: | ||
``` | ||
docker-compose up --build | ||
``` | ||
|
||
Start beekeeper with overriden values depending on the use-case: | ||
1. Setup | ||
``` | ||
docker-compose -f docker-compose.yml -f docker-compose.vm.yml up --build | ||
``` | ||
|
||
# Register a beehive with beekeeper (example) | ||
|
||
1) The first step creates a beehive but credentials will be missing. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
version: '3.7' | ||
services: | ||
node1: | ||
image: waggle/node-platforms:node1 | ||
build: | ||
context: node-platforms/vm | ||
dockerfile: Dockerfile | ||
args: | ||
VSN: vsn1 | ||
NODE_ID: "0000000000000001" | ||
|
||
node2: | ||
image: waggle/node-platforms:node2 | ||
build: | ||
context: node-platforms/vm | ||
dockerfile: Dockerfile | ||
args: | ||
VSN: vsn2 | ||
NODE_ID: "0000000000000002" | ||
volumes: | ||
- ${PWD}/beekeeper-keys/registration_certs/untilforever/registration:/etc/waggle/sage_registration_readonly:ro | ||
- ${PWD}/beekeeper-keys/registration_certs/untilforever/registration-cert.pub:/etc/waggle/sage_registration-cert.pub_readonly:ro | ||
# for /etc/ssh/ssh_known_hosts: | ||
- ${PWD}/beekeeper-keys/certca/beekeeper_ca_key.pub:/etc/waggle/beekeeper_ca_key.pub:ro | ||
# so beekeeper can ssh into it: | ||
- ${PWD}/beekeeper-keys/nodes-key/nodes.pem.pub:/root/.ssh/authorized_keys:ro |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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).
This will generate
node1_1
andnode1_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.