-
Notifications
You must be signed in to change notification settings - Fork 42
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
Add offline docker example for air gapped networks #160
Conversation
This adds an example of how to use heartbeat / synthetics in an air gapped network, where our calls to NPM won't work. Users will have to pre-bake a container on a machine with internet access and ship that behind their firewall.
/test |
/test please |
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.
@andrewvc I tried running this (build-offline-dockerfile.sh
) on a machine with no images, for it to build one locally, but get the following error when it gets to step 6:
Step 6/6 : RUN cd /opt/synthetics-suites/todos && npm install && npm install playwright-chromium
---> Running in 5561c4d6f064
npm WARN checkPermissions Missing write access to /opt/synthetics-suites/todos
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /opt/synthetics-suites/todos
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/opt/synthetics-suites/todos'
npm ERR! [Error: EACCES: permission denied, access '/opt/synthetics-suites/todos'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/opt/synthetics-suites/todos'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /usr/share/heartbeat/.npm/_logs/2020-12-08T11_18_21_312Z-debug.log
This is on a VM where I can run the normal docker example, so I don't think is related to #156
@paulb-elastic this should be fixed in the latest commits, however, it won't work quite right until this PR is merged, because I made some changes to the base image, and the example references the published images. However, if you run the |
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.
Thanks @andrewvc , LGTM 👍
examples/todos/run-offline-docker.sh
Outdated
@@ -0,0 +1,2 @@ | |||
#!/bin/sh | |||
../docker/run.sh my-custom-heartbeat |
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.
nit: It seems to me that this could be move to docs or to the readme
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'll remove this
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.
@andrewvc , I've built the image locally. The build is successful but the test suite fails, the reason is that when the suite directory is copied into the image it also flattens the file structure therefore it can't load the index.html
at the specified location in the tests. I've made a suggestion that fixes this.
examples/todos/Dockerfile
Outdated
|
||
RUN mkdir -p $SUITES_DIR/todos | ||
# Copy your custom synthetics tests into a folder on the image | ||
COPY ./* $SUITES_DIR/todos/ |
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.
COPY ./* $SUITES_DIR/todos/ | |
COPY . $SUITES_DIR/todos/ |
Co-authored-by: Hamid <[email protected]>
This adds an example of how to use heartbeat / synthetics in an air gapped network, where our calls to NPM won't work. Users will have to pre-bake a container on a machine with internet access and ship that behind their firewall.