Skip to content
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

request to moving location of Dockerfile #814

Open
shimwell opened this issue Jul 7, 2022 · 10 comments
Open

request to moving location of Dockerfile #814

shimwell opened this issue Jul 7, 2022 · 10 comments
Assignees

Comments

@shimwell
Copy link
Member

shimwell commented Jul 7, 2022

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:

  • 4 lines of code in .github/workflows/docker_publish.yml
  • 4 lines of code in CI/update_docker.sh

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

@gonuke
Copy link
Member

gonuke commented Jul 8, 2022

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

If so:

  • if there is ever more than 1 Dockerfile in the repo, I think it is wise/instructive to specify which one explicitly (even if it is the default)
  • let's wait until the transition is over to see how many Dockerfiles we end up with

@shimwell
Copy link
Member Author

shimwell commented Jul 8, 2022

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
Copy link
Member Author

shimwell commented Jul 8, 2022

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
Copy link
Member

gonuke commented Jul 8, 2022

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
Copy link
Member

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
Copy link
Member

gonuke commented Feb 12, 2024

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
Copy link
Member

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
Copy link
Member

gonuke commented Feb 16, 2024

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
Copy link
Member

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

@gonuke
Copy link
Member

gonuke commented Mar 4, 2024

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?

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

No branches or pull requests

3 participants