Open jcalfee opened 6 years ago
@jcalfee wouldn't this mean the user has to run Beaker inside docker? What's the downside there?
You don't have to run Beaker inside of Docker (although you might want to)..
I'll be happy to help you with Docker goals. Basically if the binary is compatible with the host OS you can just copy any files you want from the docker to the host machine.
To peak our interests (quick rant): I'm moving towards running everything from a Docker file for lots of reasons security (unless there is a better solution). It is still complicated to do but there is a script that is making this practical for an advanced computer user. This could become part of a packing system and available to everyone. The only thing I can think of that makes this unnecessary is to have perfect code built by redundant build machines all attesting that they got a reproducible build hash. The 1st case will never happen. So sand-boxing apps on a PC / Desktop are something I think we are going to need if we want decent security.
I've used docker but not extensively. Having Beaker run in docker is definitely out of scope right now. What would the details be of distributing via docker? How would that change things for us doing dev/distribution, and for users downloading it?
This week is going to be difficult for me to get questions answered about automated release builds. This is what we have, but I have to ask if they will continue this route: https://github.com/EOSIO/eos/blob/slim/.gitlab-ci.yml
I can find out more about release builds soon though and get a recommendation, probably next week..
If your solution is docker based, once you get your base image and build worked out it is just a matter of configuration and maybe some re-factoring.. You can setup automated builds for github releases for example or automated unit testing on each push (the last commit runs in a docker).
It is a good idea to have a builder image separate from your source code (see multiple FROM entries in eosio/eos' Dockerfile). This way it is more efficient to do frequent source builds (no deps to install) and more developer friendly (they can just use the builder then git clone manually).
Our Dockerfile seems to be pretty stable now: https://github.com/EOSIO/eos/blob/dawn-v3.0.0/Docker/Dockerfile
Here are some suggestions:
Automated builds (w/docker plug-in) https://github.com/EOSIO/eos/blob/slim/.buildkite/pipeline.yml Automated docker unit test: https://github.com/EOSIO/eosjs/blob/master/.travis.yml
fyi, why eosio is using Buildkite:
Eric Buildkite for both automated builds and unit tests Travis was taking over and hour to complete both, if it completed at all. With buildkite it is right around 20 minutes
Back to the opening post...
Looking at the logs from npm run rebuild
, at least one of the dependencies fails to build due to it containing a npm version requirement in its package.json
. The version of npm contained in debian:sid being very old 1.4.21
.
You might get better results using node:carbon
, or one of its variants, rather than debian:sid
.
To run beaker from within docker you will need to add windowing support.
Thanks, looks like FROM ubuntu:bionic
is a better choice. That gets me to this point:
...
> beakerbrowser@ build /beaker
> gulp build
[13:46:00] Using gulpfile /beaker/gulpfile.js
[13:46:00] Starting 'burnthemall-maybe'...
[13:46:00] Finished 'burnthemall-maybe' after 977 μs
[13:46:00] Starting 'bundle'...
[13:46:00] Starting 'less'...
[13:46:00] Finished 'less' after 19 ms
'TimeoutError' is imported from external module 'beaker-error-constants' but never used
'default' is imported from external module 'bytes' but never used
'TimeoutError' is imported from external module 'beaker-error-constants' but never used
'default' is imported from external module 'parse-dat-url' but never used
'TimeoutError' is imported from external module 'beaker-error-constants' but never used
'FSArchiveFolder' and 'FSArchiveFile' are imported from external module 'beaker-virtual-fs' but never used
'join' is imported from external module 'path' but never used
'TimeoutError' is imported from external module 'beaker-error-constants' but never used
'default' is imported from external module 'function-queue' but never used
'DestDirectoryNotEmpty' is imported from external module 'beaker-error-constants' but never used
[13:46:03] 'bundle' errored after 3.2 s
[13:46:03] Error: Cannot find module 'remarkable' from '/beaker/app'
at /beaker/node_modules/browser-resolve/node_modules/resolve/lib/async.js:46:17
at process (/beaker/node_modules/browser-resolve/node_modules/resolve/lib/async.js:173:43)
at ondir (/beaker/node_modules/browser-resolve/node_modules/resolve/lib/async.js:188:17)
at load (/beaker/node_modules/browser-resolve/node_modules/resolve/lib/async.js:69:43)
at onex (/beaker/node_modules/browser-resolve/node_modules/resolve/lib/async.js:92:31)
at /beaker/node_modules/browser-resolve/node_modules/resolve/lib/async.js:22:47
at FSReqWrap.oncomplete (fs.js:152:21)
NPM versoin 3.5.2 Nodejs 8.10.0
Operation System: Docker Beaker version: 0.8.0-prerelease.5
Any interest in a Docker build? I noticed there are a number of extra steps needed to build in beaker in a minimal image. I started the process but I gotinto some npm errors / missing packages that I don't understand. This should be a good start if someone cares to review and complete it.
npm run rebuild
was running into missing packages (gulp-less gulp-watch, etc) so I tried adding anpm install
(even though that is not in your directions.Once it all works, the RUN lines can be merged together and more files removed so the final docker image size will be smaller.