Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@bani6809
Copy link
Contributor

No description provided.

@bani6809 bani6809 requested review from jphannifan and jwise April 25, 2024 18:27
@riptidewave93
Copy link
Contributor

Instead of scripts, maybe these should be a makefile command? make build-docker for example?

@bani6809
Copy link
Contributor Author

Instead of scripts, maybe these should be a makefile command? make build-docker for example?

make assumes you even have make/gcc/etc installed, which a barebones linux install may not have, WSL does not for sure. the docker is guaranteed to.

@@ -0,0 +1 @@
sudo docker run --name x1plus -it -v `pwd`:/work x1plus
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we have users run the prebuilt docker image instead of building it themselves? then we know they'll get the same thing we have in CI

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say yes, a prebuilt image is preferred - not everyone might have a powerful machine on hand to build the base image fast.

I'd probably also commit the /work directory into the image so that no git checkout is necessary for basic work/build. That way it's an atomic, "guaranteed to work" image.

Another note I'd add here is running the container in detached mode. With the current commands (especially the ones provided in the README), for each command, a new container is spun up then shut down once the command completes. With a detached container, just by referring to the name and using exec instead of run, a lot of resources can be saved.

For example the current README approach is:

$ docker run -u `id -u` -v `pwd`:/work x1plusbuild bash -c 'git config --global --add safe.directory /work'
$ docker run -u `id -u` -v `pwd`:/work x1plusbuild make scripts
$ scp scripts/getkey root@bambu:/tmp
$ ssh root@bambu /tmp/getkey >> localconfig.mk
$ docker run -u `id -u` -v `pwd`:/work x1plusbuild make

Which could be modified to:

$ docker run -d --name x1plus -u `id -u` -v `pwd`:/work x1plusbuild 
$ docker exec -it x1plus bash -c 'git config --global --add safe.directory /work'
$ docker exec -it x1plus make scripts
$ scp scripts/getkey root@bambu:/tmp
$ ssh root@bambu /tmp/getkey >> localconfig.mk
$ docker exec -it x1plus make
$ docker stop x1plus
// Later on, the same container can be spun up with
$ docker start x1plus

@jwise
Copy link
Member

jwise commented Apr 28, 2024

I think I agree that this is not a make thing but also I'm not sure we need to provide these scripts at all. if you don't have make installed you probably don't have docker installed either :)

@bani6809
Copy link
Contributor Author

I think I agree that this is not a make thing but also I'm not sure we need to provide these scripts at all. if you don't have make installed you probably don't have docker installed either :)

i dont have make installed on the host because i dont want a minimalist host. build env is inside the container not outside.

@bani6809 bani6809 requested a review from jwise April 28, 2024 23:54
@riptidewave93
Copy link
Contributor

Personally I feel these are unneeded with good documentation, but that's just me. 🤷‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants