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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding multistage-build for slimmer container #3012

Merged
merged 5 commits into from
Jul 10, 2022

Conversation

vsoch
Copy link
Contributor

@vsoch vsoch commented May 16, 2022

This is a small update to add a (much smaller) multistage build for mfem. This means the original Dockerfile is renamed to Dockerfile.base, and the new (smaller) one is the Dockerfile that builds to the smaller image. The namespace (final container names) does not change, but we add ghcr.io/mfem/mfem-ubuntu (without the base).

But I am currently running into an issue where when I shell inside my backspace turns into a forward space, and I am hoping someone can reproduce to determine if there is a bug we need to track down or if I am just a nut :) Here is the bug as I see it:

https://asciinema.org/a/495023?speed=2

To reproduce, just build the container and shell inside, and then try to navigate around.

docker build -f config/docker/Dockerfile -t ghcr.io/mfem/mfem-ubuntu .
docker run -it ghcr.io/mfem/mfem-ubuntu

It would be good if someone can reproduce it because my conclusion at this point is "there is a ghost in this container!" 馃槅

Signed-off-by: vsoch vsoch@users.noreply.github.com

PR Author Editor Reviewers Assignment Approval Merge
#3012 @vsoch @tzanio @jandrej + @tzanio + @acfisher 6/19/22 7/7/22 7/10/22
PR Checklist
  • Code builds.
  • Code passes make style.
  • Update CHANGELOG:
    • Is this a new feature users need to be aware of? New or updated example or miniapp?
    • Does it make sense to create a new section in the CHANGELOG to group with other related features?
  • Update INSTALL:
    • Had a new optional library been added? If so, what range of versions of this library are required? (Make sure the external library is compatible with our BSD license, e.g. it is not licensed under GPL!)
    • Have the version ranges for any required or optional libraries changed?
    • Does make or cmake have a new target?
    • Did the requirements or the installation process change? (rare)
  • Update continuous integration server configurations if necessary (e.g. with new version requirements for each of MFEM's dependencies)
    • .github
    • .appveyor.yml
  • Update .gitignore:
    • Check if make distclean; git status shows any files that were generated from the source by the project (not an IDE) but we don't want to track in the repository.
    • Add new patterns (just for the new files above) and re-run the above test.
  • New examples:
    • All sample runs at the top of the example source file work.
    • Update examples/makefile:
      • Add the example code to the appropriate SEQ_EXAMPLES and PAR_EXAMPLES variables.
      • Add any files generated by it to the clean target.
      • Add the example binary and any files generated by it to the top-level .gitignore file.
    • Update examples/CMakeLists.txt:
      • Add the example code to the ALL_EXE_SRCS variable.
      • Make sure THIS_TEST_OPTIONS is set correctly for the new example.
    • List the new example in doc/CodeDocumentation.dox.
    • If new examples directory (e.g.examples/pumi), list it in doc/CodeDocumentation.conf.in
    • Companion pull request for documentation in mfem/web repo:
      • Update or add example-specific documentation, see e.g. the src/examples.md.
      • Add the description, labels and screenshots in src/examples.md and src/img.
      • In examples.md, list the example under the appropriate categories, add new categories if necessary.
      • Add a short description of the example in the "Extensive Examples" section of features.md.
  • New miniapps:
    • All sample runs at the top of the miniapp source file work.
    • Update top-level makefile and makefile in corresponding miniapp directory.
    • Add the miniapp binary and any files generated by it to the top-level .gitignore file.
    • Update CMake build system:
      • Update the CMakeLists.txt file in the miniapps directory, if the new miniapp is in a new directory.
      • Add/update the CMakeLists.txt file in the new miniapp directory.
      • Consider adding a new test for the new miniapp.
    • List the new miniapp in doc/CodeDocumentation.dox
    • If new miniapps directory (e.g.miniapps/nurbs), add it to MINIAPP_SUBDIRS in the makefile.
    • If new miniapps directory (e.g.miniapps/nurbs), list it in doc/CodeDocumentation.conf.in
    • Companion pull request for documentation in mfem/web repo:
      • Update or add miniapp-specific documentation, see e.g. the src/meshing.md and src/electromagnetics.md files.
      • Add the description, labels and screenshots in src/examples.md and src/img.
      • The miniapps go at the end of the page, and are usually listed only under a specific "Application (PDE)" category.
      • Add a short description of the miniapp in the "Extensive Examples" section of features.md.
  • New capability:
    • All new public, protected, and private classes, methods, data members, and functions have full Doxygen-style documentation in source comments. Documentation should include descriptions of member data, function arguments and return values, template parameters, and prerequisites for calling new functions.
    • Pointer arguments and return values must specify whether ownership is being transferred or lent with the call.
    • Any new functions should include descriptions of their intended use e.g. for internal use only, user-facing, etc., along with references to example code whenever possible/appropriate.
    • Consider adding new sample runs in existing examples to highlight the new capability.
    • Consider saving cool simulation pictures with the new capability in the Confluence gallery (LLNL only) or submitting them, via pull request, to the gallery section of the mfem/web repo.
    • If this is a major new feature, consider mentioning it in the short summary inside README (rare).
    • List major new classes in doc/CodeDocumentation.dox (rare).
  • Update this checklist, if the new pull request affects it.
  • Run make unittest to make sure all unit tests pass.
  • Run the tests in tests/scripts.
  • (LLNL only) After merging:
    • Update internal tests to include the new features.

I am currently running into an issue where when I shell inside my backspace turns
into a forward space, and I am hoping someone can reproduce to determine if there
is a bug we need to track down or if I am just a nut :)

Signed-off-by: vsoch <vsoch@users.noreply.github.com>
@jandrej
Copy link
Member

jandrej commented May 17, 2022

I'm trying to reproduce. Is it right that I have to pull a 6GB container layer?
376e7f300b86: Downloading 13.5MB/5.991GB

@vsoch
Copy link
Contributor Author

vsoch commented May 17, 2022

Unfortunately yes - the full development environment has ALL the things. But when you do the multistage build off of that base I think the entire thing goes down to 2-3GB. The user of this container won't need to pull that chonker!

vsoch added 3 commits May 17, 2022 15:32
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
@vsoch
Copy link
Contributor Author

vsoch commented May 17, 2022

okay I think the bug is fixed! Thanks @jandrej for the help!! 馃コ

I can remove the PR trigger after review. As before, I know not to do any force pushes, etc.

@stale
Copy link

stale bot commented Jun 18, 2022

鈿狅笍 This issue or PR has been automatically marked as stale because it has not had any activity in the last month. If no activity occurs in the next week, it will be automatically closed. Thank you for your contributions.

@stale stale bot added the stale label Jun 18, 2022
@jandrej
Copy link
Member

jandrej commented Jun 18, 2022

Sorry @vsoch, the PR kinda went under water.

@vsoch
Copy link
Contributor Author

vsoch commented Jun 18, 2022

No worries, it鈥檚 ok.

@tzanio
Copy link
Member

tzanio commented Jun 19, 2022

This PR is now under review (see the table in the PR description). To help with the review process, please do not force push to the branch.

@tzanio tzanio added this to the mfem-5.0 milestone Jun 19, 2022
@tzanio tzanio added this to Review Now in Pull Requests via automation Jun 19, 2022
@tzanio
Copy link
Member

tzanio commented Jun 24, 2022

@acfisher, can you please take a look when you get a chance?

@@ -2,6 +2,9 @@ name: Build Deploy Container

on:

# TODO MUST REMOVE BEFORE MERGING THIS IS TO TEST BUILD ONLY
Copy link
Member

Choose a reason for hiding this comment

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

Remember to remove this

Signed-off-by: vsoch <vsoch@users.noreply.github.com>
@tzanio
Copy link
Member

tzanio commented Jul 7, 2022

Merged in next for testing...

Copy link
Member

@tzanio tzanio left a comment

Choose a reason for hiding this comment

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

Thank you @vsoch !

@tzanio tzanio merged commit 3d7b3b1 into mfem:master Jul 10, 2022
Pull Requests automation moved this from Review Now to Merged Jul 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Pull Requests
  
Merged
Development

Successfully merging this pull request may close these issues.

None yet

4 participants