svalinn / DAGMC

Direct Accelerated Geometry Monte Carlo Toolkit
https://svalinn.github.io/DAGMC
Other
96 stars 63 forks source link

request to moving location of Dockerfile #814

Open shimwell opened 2 years ago

shimwell commented 2 years ago

The Dockerfile is located in the CI folder but designed to be built when the current working directory is the root repository folder. The are COPY commands in the dockerfile that need the file to be run from one directory up.

I would be keen to move the Dockerfile to the root repository level.

This will be simpler to build but also save:

If people think this is a good idea I shall put in a PR for this to follow on PR #813

gonuke commented 2 years ago

It seems like all the savings are due to no longer having to manually specify the Dockerfile; is that right?

If so:

shimwell commented 2 years ago

Yep you are right, the savings are due to having the Dockerfile with the default name and that default being used by the build command.

shimwell commented 2 years ago

I also think this change would be worth it just to improve the building, currently you must perform the docker build command from the root directory which is not same directory as dockerfile itself. The dockerfile has COPY commands that need viability of the CI folder. Therefore we have a bit of confusing situation where developers really have to think about location, relative location and absolute paths which is an unnecessary complexity.

gonuke commented 2 years ago

Sure- but much of that may disappear as we move through the steps in https://github.com/svalinn/DAGMC/projects/6 - so let's revisit then, and move this further down the list of actions?

ahnaf-tahmid-chowdhury commented 6 months ago

I believe the current Docker setup is tailored for CI builds, and it's a beneficial practice to store different Dockerfiles in separate directories based on their use cases, considering our use of GitHub workflows.

gonuke commented 6 months ago

Historically, I've hoped that our CI Dockerfile can be a useful guide for the average collaborator who wants to build from source. However, it always seems to deteriorate as we make the CI Dockerfile more complicated to support things we do in CI space.

Therefore, I wonder if we should publish an additional Dockerfile that is streamlined but complete for the average collaborator to build directly.

Pro: there is clear guidance for this type of user

Con: we have to ensure that it stays up-to-date/current with other changes - it could be tested separately

ahnaf-tahmid-chowdhury commented 6 months ago

I think our current Dockerfile is sufficient for our needs. Instead of creating an additional Dockerfile, we could focus on updating our documentation to provide clearer guidance for collaborators. Additionally, rather than introducing another separate Dockerfile that requires separate testing, we could explore creating a multi-stage build that produces a smaller image containing only the necessary binary files. This streamlined approach could be more efficient for users without adding complexity to our workflows.

gonuke commented 6 months ago

There are many competing interests here to manage:

  1. guidance for users, where documentation can be a substitute
  2. providing a robust Dockerfile for users to use with minimal configuration, perhaps our Dockerfile does that if used with no build-args
  3. providing a Docker image for users to use, perhaps we can make variations of this by publishing with different sets of build-args

A PR that takes care of these things would be welcome

ahnaf-tahmid-chowdhury commented 6 months ago

@gonuke, I think I should cover this issue on #951 as well.

gonuke commented 6 months ago

I worry that our CI Dockerfile is far more complicated than many users want to worry about. I've always hoped that we could have a single Dockerfile for CI and for the average user, but wonder if we are better off with two?