-
Notifications
You must be signed in to change notification settings - Fork 131
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
Docker image improvements and Makefile targets #563
base: master
Are you sure you want to change the base?
Conversation
…ad section and building as well as expecting a license files to be included
I do not think we should move forward with most of the changes in this pull request.
The only change that might be alright is changing the order of |
Yes. the order in yaml must agree with the dependencies.
We need to finally land #218, then the check would no longer have to be manual. |
@rbs-jacob I can remove the comments and the setup.py related commands but otherwise I think the rest of the changes are worthwhile. The current method for downloading, building, and running ofrak in a container as outlined by the documenta is cumbersome. Moreover there is no easy way to run the tests locally that are ran on the remote (github) without examining the test-all.yml. Which again, in my opinion, is cumbersome. Users shouldn't have to have a deep understanding of the ofrak build system in order to simply build and run it in a container. Take the following two key changes for example: .PHONY: ofrak-%
ofrak-%: ## Build OFRAK image using ofrak-<name>
@echo "Building OFRAK image using config: ofrak-$*.yml"
python3 build_image.py --config ofrak-$*.yml --base --finish
.PHONY: start-ofrak-%
start-ofrak-%: ## Start OFRAK image using ofrak-<name>
make ensure-ofrak-license image_name=$*
@echo "Starting OFRAK image using config: ofrak-$*.yml..."
docker run \
--rm \
--detach \
--hostname ofrak \
--name ofrak-$* \
--interactive \
--tty \
--publish 8877:80 \
--volume $(PWD)/ofrak.license:/ofrak.license \
redballoonsecurity/ofrak/$*:latest I would argue these are barely more complex than the normal commands that the user would execute to build and run ofrak in a container. For example if a user wanted to use the ofrak-dev.yml config file they would either need to edit the existing makefile or run: python3 build_image.py --config ofrak-dev.yml --base --finish
docker run --rm --detach --hostname ofrak --name ofrak-dev --interactive --tty --publish 8877:80 --volume $(PWD)/ofrak.license:/ofrak.license redballoonsecurity/ofrak/dev:latest Theres a fair number of unintuitive arguments for each command as shown by the fact that we have a ~600 word documentation section just to describe the two commands needed to build and run docker. But by adding these to the Makefile we simplify it for the user such they they would only have to run: make ofrak-dev
make start-ofrak-dev Moving patch_maker to the top beginning of the yaml made a big difference in how often that layer's cache becomes invalidated by changes in other layers. Given the time required to download and build this stage (easily ~30 minutes on some systems), this small change makes a big difference. If the order of the yaml matters, we should clearly document it and explore other ways of keeping patch_maker's layer cache from becoming invalid. As for the licensing it requires the user to have generated the ofrak.license file, a step that is automatically invoked if the file is missing when the user runs either of the start commands. This brings up the |
Authored by @Jepson2k
One sentence summary of this PR (This should go in the CHANGELOG!)
Fix small issues with Docker images and add Makefile targets for creating/starting them.
Link to Related Issue(s)
#547
Please describe the changes in your request.
Anyone you think should look at this, specifically?