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

Addressing docker comments #668

Merged
merged 76 commits into from
May 28, 2020
Merged

Addressing docker comments #668

merged 76 commits into from
May 28, 2020

Conversation

bam241
Copy link
Member

@bam241 bam241 commented Apr 2, 2020

This address comments from #660 about Docker.

I added something from me as well, see if I can separate the housekeeping jobs from the others... and that way simply the travis CI file

@bam241 bam241 changed the title [WIP] Addressing docker comments Addressing docker comments Apr 2, 2020
@bam241
Copy link
Member Author

bam241 commented Apr 2, 2020

@kkiesling @pshriwise @gonuke this is ready for review.

Copy link
Member

@pshriwise pshriwise left a comment

Choose a reason for hiding this comment

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

Just one small comment from me. Nice cleanup of the housekeeping check!


source ${docker_env}

rm -rf ${geant4_build_dir}/bld ${geant4_install_dir}
mkdir -p ${geant4_build_dir}/bld
cd ${geant4_build_dir}
wget http://geant4.cern.ch/support/source/geant4.${geant4_version}.tar.gz
wget https://geant4.cern.ch/support/source/geant4.${geant4_version}.tar.gz --no-check-certificate
Copy link
Member

Choose a reason for hiding this comment

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

In #660 they mention verifying our file against a checksum. Where do we stand on adding that?

Copy link
Member Author

Choose a reason for hiding this comment

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

did not found any checksum for geant4 tarball :(

Copy link
Member

Choose a reason for hiding this comment

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

We could generate a checksum against the version we are pulling

Copy link
Member Author

Choose a reason for hiding this comment

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

make sense !

# Get some pip packages
RUN pip install cython sphinx
RUN pip install cython
Copy link
Member

Choose a reason for hiding this comment

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

Why was sphinx moved out of this file?

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like anything having to do w/ housekeeping was moved to the housekeeping.sh file.

docker/Dockerfile Show resolved Hide resolved
@@ -13,7 +13,6 @@ fi
rm -rf ${dagmc_build_dir}/bld ${dagmc_install_dir}
mkdir -p ${dagmc_build_dir}/bld
cd ${dagmc_build_dir}
#git clone https://github.com/svalinn/DAGMC -b develop
Copy link
Member

Choose a reason for hiding this comment

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

The reason these lines were commented is that they would normally be part of a DAGMC build script, but in this specific case, we get the DAGMC source code by copying it into the docker image, not cloning it from github.

Copy link
Contributor

Choose a reason for hiding this comment

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

@ljacobson64 is there any reason to leave this line in as a comment w/ justification or can we just remove it all together? (see here)

Copy link
Member Author

@bam241 bam241 Apr 6, 2020

Choose a reason for hiding this comment

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

If I understand correctly, there are there just because the normal install DAGMC procedure should include them. But in this case as we copy the DAGMC from the PR (using Travis) we don't need them.

If this is correct, I don't think they should be there:
Those scripts are dedicated for CI not to show people how to install DAGMC.
It is probably a good idea to have a version of them somewhere to facilitate DAGMC install but for me this is definitely not the place.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree w/ this assessment @bam241. I think the lines here should be removed and if we want a docker to help users, we need to host that elsewhere.

Copy link
Member

Choose a reason for hiding this comment

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

For maintainability purposes, I think it would be good to have some indication of why the source code already exists in this directory. (The current situation with just a commented git clone line is also not very helpful.) Perhaps a comment line that says

# DAGMC source code already exists in this directory because it was copied into
# the docker image by travis.yml

Copy link
Member Author

Choose a reason for hiding this comment

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

I think I understand,

the line is left there to highlight that we don't need to copy DAGMC source, while we normally would in a standard installation process.
So the line is basically there for educational purposes...
Is that correct @ljacobson64 ?

I would definitely prefer to not mix purposes in those scripts. So if there are used for CI install and testing, I would remove the git clone line and add the comment at the head of the file.

@@ -29,4 +28,3 @@ cmake ../src -DMOAB_DIR=${moab_install_dir} \
make -j${jobs}
make install
cd
#rm -rf ${dagmc_build_dir}
Copy link
Member

Choose a reason for hiding this comment

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

The dagmc_build_dir would normally be deleted after building DAGMC, but we need to keep it in this specific case in order to run the tests.

Copy link
Contributor

Choose a reason for hiding this comment

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

My same question above applies here too- do you think it should be left in as a comment w/ an explanation or removed?

Copy link
Member Author

@bam241 bam241 Apr 5, 2020

Choose a reason for hiding this comment

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

@ljacobson64

agreed with @kkiesling if this is commented without explanation it should not be part of the build.
I'd be happy to add them back with a line of explanation.

when you mean run the tests, do you mean run the test locally ?
Because we run the test in CI without those...

Copy link
Member

Choose a reason for hiding this comment

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

I think this line can be deleted.

To answer @bam241's question: I do mean for running the tests in CI. The CI runs make test in the DAGMC build directory, so the DAGMC build directory must exist in order to run the tests. See here: https://github.com/bam241/DAGMC/blob/fix_docker/docker/travis.tests.sh#L28

.travis.yml Outdated
- env: UBUNTU_VERSION=18.04 COMPILER=clang HDF5_VERSION=1.10.4 MOAB_VERSION=develop
if: type != pull_request
- stage: housekeeping
env: UBUNTU_VERSION=16.04 COMPILER=gcc HDF5_VERSION=1.10.4 MOAB_VERSION=5.1.0
Copy link
Member

Choose a reason for hiding this comment

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

The housekeeping run should use 18.04

Copy link
Member Author

Choose a reason for hiding this comment

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

oups this was not intended

docker/Dockerfile Show resolved Hide resolved
Copy link
Contributor

@kkiesling kkiesling left a comment

Choose a reason for hiding this comment

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

I have no major comments. Thanks @bam241!

# Get some pip packages
RUN pip install cython sphinx
RUN pip install cython
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like anything having to do w/ housekeeping was moved to the housekeeping.sh file.

@bam241
Copy link
Member Author

bam241 commented Apr 5, 2020

@ljacobson64 to avoid having the housekeeping stuff everywhere and only used for 1 job in ubuntu 18.04. I moved astyle and sphinx install in the housekeeping scripts.

@@ -18,6 +18,9 @@ if [ "${TRAVIS_REPO_SLUG}" == "svalinn/DAGMC" ] && \
fi
fi

# install package for style check
apt-get install astyle
Copy link
Member

Choose a reason for hiding this comment

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

Why are we moving this to here?

@@ -19,7 +19,7 @@ cd ${dagmc_build_dir}/bld
# If this is not a pull request, get files needed for regression tests
if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
cd src/make_watertight/tests
wget ${MW_REG_TEST_MODELS_URL} -O mw_reg_test_files.tar.gz -o wget.out
wget ${MW_REG_TEST_MODELS_URL} -O mw_reg_test_files.tar.gz
Copy link
Member

Choose a reason for hiding this comment

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

The comment suggested streaming these to stderr and stdout - do we do this now? Or is that default behavior?

Copy link
Member Author

@bam241 bam241 Apr 8, 2020

Choose a reason for hiding this comment

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

my understanding of the comment was the default behavior streams them to stderr

@gonuke
Copy link
Member

gonuke commented Apr 8, 2020

I'm ambivalent on the housekeeping changes. They may happen fairly often, which means a lot of apt install and pip installing for stuff we could do once. Should we have different docker images? Would that help?

@bam241
Copy link
Member Author

bam241 commented Apr 8, 2020

I was thinking @ljacobson64 @kkiesling @pshriwise @gonuke
For separation of concern what do you think about:

  • creating a .travis_scripts folder containing all the scripts required for CI (exept the update_docker.sh one)
  • keep only the Dockerfile and the update_docker.sh macro in the docker folder
  • create a script folder, with a version of the install scripts dedicated to installation for users ?

@ljacobson64
Copy link
Member

That kind of sounds like overkill. I'd rather just delete those 2 lines we were discussing

@bam241
Copy link
Member Author

bam241 commented Apr 8, 2020

That kind of sounds like overkill. I'd rather just delete those 2 lines we were discussing

Yes but I feel like it will clarify the purpose of everything.
It is just that it does not seems obvious to me, that the scripts used to install and run the tests in CI would be located in the docker folder

@ljacobson64
Copy link
Member

Would it make more sense if the docker folder were renamed CI?

@bam241
Copy link
Member Author

bam241 commented Apr 10, 2020

@gonuke @kkiesling @ljacobson64 this should be ready for an around of review

@bam241
Copy link
Member Author

bam241 commented Apr 16, 2020

@ljacobson64 @kkiesling I think I am now satisfied with the way it looks.

cc @pshriwise @gonuke

@gonuke
Copy link
Member

gonuke commented Apr 25, 2020

Should we test some of this by adding an automatic build to dockerhub?

@ljacobson64
Copy link
Member

How does that work?

@gonuke
Copy link
Member

gonuke commented Apr 25, 2020

You point dockerhub at a Dockerfile in a github repo and everytime that repo changes, it rebuilds the image. We have deployed it for

So far they have all been for images whose configuration is 100% defined in the dockerfile, so I don't know how it will behave for this image that requires scripts...

@bam241
Copy link
Member Author

bam241 commented Apr 25, 2020

@gonuke this seems like a good idea, will take a look at this

@gonuke
Copy link
Member

gonuke commented Apr 27, 2020

@gonuke
Copy link
Member

gonuke commented Apr 27, 2020

The dockerhub build is taking a long time.... probably not surprising

@gonuke
Copy link
Member

gonuke commented Apr 27, 2020

Looks like it might have timed out...

@bam241
Copy link
Member Author

bam241 commented Apr 27, 2020

@gonuek if we want to do the automated one, we will probably need 2 dockerfiles one for each ubuntu version

@ljacobson64
Copy link
Member

We could stop supporting 16.04 since it's 4 years old now

@ljacobson64
Copy link
Member

Although in that case we may as well start supporting 20.04...

@bam241
Copy link
Member Author

bam241 commented Apr 27, 2020

@gonuke I think we will have problem....
timeout limits is set to 2h
https://success.docker.com/article/what-are-the-current-resource-limits-placed-on-automated-builds

@bam241
Copy link
Member Author

bam241 commented Apr 27, 2020

I think the main problem is building geant4... that takes forever....

@bam241
Copy link
Member Author

bam241 commented May 15, 2020

@ljacobson64 @gonuke I this I addressed your last comments :)

@bam241 bam241 force-pushed the fix_docker branch 2 times, most recently from 3453826 to e8a5e60 Compare May 15, 2020 16:30
Copy link
Member

@gonuke gonuke left a comment

Choose a reason for hiding this comment

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

Thanks @bam241

@bam241
Copy link
Member Author

bam241 commented May 27, 2020

@ljacobson64 do you have any other comments ?

@ljacobson64
Copy link
Member

Has the docker image on dockerhub already been updated? I'm curious about how the tests are passing if it hasn't. Unless the new docker image is the same as the old one despite having a new Dockerfile.

@bam241
Copy link
Member Author

bam241 commented May 27, 2020

Yes the docker container have been updated/pushed after last dockerfile change.

Copy link
Member

@gonuke gonuke left a comment

Choose a reason for hiding this comment

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

Thank @bam241 - LGTM

@gonuke gonuke merged commit 5735430 into svalinn:develop May 28, 2020
@bam241 bam241 deleted the fix_docker branch November 28, 2024 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants