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

Update Dockerfile Julia 1.3.1->1.5.3 #62

Merged
merged 7 commits into from
Mar 12, 2021
Merged

Conversation

postylem
Copy link
Collaborator

Is there any reason not to update to Julia 1.5.3?

Use Julia 1.5.3 instead of 1.3.1 (is there any reason not to do update?)
Dockerfile Outdated Show resolved Hide resolved
make a parameter for easily changing Julia version [suggested by @fplk](probcomp#62 (comment))
Copy link
Contributor

@bzinberg bzinberg left a comment

Choose a reason for hiding this comment

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

Looks good on reading. To minimally test it, can you build and run the image and verify that the notebooks still run?

tar zxf julia-${JULIA_VERSION_FULL}-linux-x86_64.tar.gz && \
mkdir -p "${JULIA_INSTALLATION_PATH}" && \
mv julia-${JULIA_VERSION_FULL} "${JULIA_INSTALLATION_PATH}/" && \
ln -fs "${JULIA_INSTALLATION_PATH}/julia-${JULIA_VERSION_FULL}/bin/julia" /usr/local/bin/ && \
Copy link
Contributor

Choose a reason for hiding this comment

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

why /usr/local/bin rather than /usr/bin? (answer might be "the convention is pretty vague anyway," just wondering)

Copy link
Collaborator Author

@postylem postylem Feb 23, 2021

Choose a reason for hiding this comment

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

just because @fplk suggested it :) do you have a preference?

Copy link
Contributor

Choose a reason for hiding this comment

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

/usr/bin is for distribution-managed binaries.

@postylem
Copy link
Collaborator Author

postylem commented Feb 23, 2021

I tested with Dockerfile.ubuntu-2004, and it works (I can build the docker image and run the notebooks) TF now supports python 3.8, so I updated to just install tensorflow and not use the tf-nightly wheel, in this last commit.

I tested with Dockerfile and it doesn't build (something the matter with virtualenvs and python 2 vs 3). But I have this same issue in the current probcomp:master branch too, so I don't think it is related. (this issue is mentioned in issue 61)

@fplk
Copy link
Contributor

fplk commented Mar 1, 2021

Nested Virtual Environments Usually Antipattern
I know of very few scenarios in which using virtual environments inside containers is a good idea, since essentially you are just nesting virtual environments without benefit at this point - if you are already inside a container that only adds complexity.

Upgrading to 20.04 Image?
Also, Ubuntu 16.04 either is in ESM or will be very soon - maybe it makes sense to fully upgrade to the 20.04 image at this point? @marcoct @bzinberg

Comments Regarding Upgrades in Near Future
Let me also repeat two remarks regarding upgrading Julia.

Xuan mentioned:

I think Julia 1.5 should be fine. There might be issues with Genify.jl when Julia 1.6 comes along (or so McCoy tells me), but I haven't encountered them myself, and Genify is not used by other parts of the Gen ecosytem (yet).

In addition, Marco commented:

[W]e are good to upgrade. I added Julia 1.5 to the Travis build in the hackathon and it passes. (edited)
Depending on what version of Gen gets installed by the Docker file, it may not have been tested with Julia 1.5. I don't anticipate there were any issues with it, but it would probably also be good to update the Docker file to run with the latest version of Gen. That seems more involved though, since the notebooks would need to be tested against the latest version of Gen -- there is some non-negligible probability that some of them might have become broken when run in with the latest version of Gen -- and testing this is not currently automated. So, to summarize, updating Julia should be fine; updating Gen might be more involved. Both seem important, and if anything updating Gen version is more important.

@fplk
Copy link
Contributor

fplk commented Mar 1, 2021

Consolidated Base Image with Gen Main Project
One important thing I just remembered: I actually wanted to use the main Gen image for this, see probcomp/Gen.jl#312

The original idea was that if we have solid Gen images for CPU and GPU projects like gen-quickstart and GenSceneGraphs could inherit from it. You will see that the Julia installation there is virtually identical to what I proposed above (it's just still on 1.5.1). When I find a free minute I can finish that PR and just adapt this repo to build upon that image. That's probably the cleanest solution. Afterwards, I can chat with Ben how and whether to base GSG on the same base image. Makes sense?

@bzinberg
Copy link
Contributor

bzinberg commented Mar 3, 2021

Missed the replies until now, sorry for the delay.

I recommend we keep the scope of this PR small so that @postylem can unblock his downstream work, and move most of the above discussion to a separate issue where it can be discussed on a separate timeline.

TBH, personally I think we should have this PR literally just change all 1.3s to 1.5s -- that makes it easier to review at the level of "this at least doesn't introduce any new bugs," unblocks @postylem's work, and substantive changes can be drafted and tested in a follow-up PR which @postylem may or may not want to drive.

Thoughts?

@postylem
Copy link
Collaborator Author

postylem commented Mar 3, 2021

As is, all this PR does is change the 1.3 to 1.5, but in a parametrized way... I don't think that should introduce any bugs, could it? I could change that back the link to /usr/bin rather than /usr/local/bin, so that's really all it does, or I could do as you say and just go back to literally changing the number, I will defer to whatever you think Ben. For what I am using it for (the gen pset), I am currently just using the 20.04 version of the dockerfile with v1.5, and it is working well.

@bzinberg
Copy link
Contributor

bzinberg commented Mar 3, 2021

I don't think that should introduce any bugs, could it?

Sadly, bugs are always possible, especially when it looks like they're impossible. But I agree, it's reasonable to keep the parameterized version number with the known risk (believed unlikely) of having to later go back and fix some unseen issue.

Given that you've verified:

  • The 20.04 image as changed in this PR builds and works
  • The 16.04 image is broken both before this PR and after this PR

I'm ok with merging the PR in its current state. @fplk, agree?

@fplk
Copy link
Contributor

fplk commented Mar 5, 2021

Merging seems fine. However, one nitpick:

RUN             python3 -m pip install --upgrade pip
RUN             python3 -m pip install jupyter jupytext matplotlib tensorflow torch

I think this creates two AUFS layers. Why? Seems like it would be better to just do:

RUN python3 -m pip install --upgrade pip && python3 -m pip install jupyter jupytext matplotlib tensorflow torch

Similarly: Is this really necessary?

RUN             git config --global user.name "Gen User"
RUN             git config --global user.email "email@example.com"

Or can we do this?

RUN git config --global user.name "Gen User" && git config --global user.email "email@example.com"

And finally, it seems like the original Dockerfile still exists. Is this intended or should we go the step and replace the old Dockerfile with 20.04?

@fplk
Copy link
Contributor

fplk commented Mar 5, 2021

@bzinberg The parametrization code was provided by me and is exactly what we use for the MCS image, so I'd consider it stable enough. If it should break unexpectedly, we both would like to know and would fix it with high priority.

@fplk
Copy link
Contributor

fplk commented Mar 5, 2021

Btw.: @bzinberg I think you need to merge this whenever you feel it's ready - I don't have rights to do so and I assume the same is true for @postylem

@postylem You can decide whether you want to address my nitpicks or not - don't think they are showstoppers, just wanted to mention it.

@postylem
Copy link
Collaborator Author

postylem commented Mar 7, 2021

I did chain those commands with &&, as you suggest @fplk (it makes sense to me, and I'd I wondered about that, though I'm rather unclear about when/whether fewer layers is desirable in general), but I left the original Dockerfile there. I thought that change should be a seperate PR, if the point of this one was just to change the julia version, not also the ubuntu version. Though, given that the ubuntu 16.04 Dockerfile seems to be broken, I could start a PR for that change too (or include it in this one, if @bzinberg thinks that's a good idea).

@bzinberg bzinberg merged commit 5b6479b into probcomp:master Mar 12, 2021
@bzinberg
Copy link
Contributor

bzinberg commented Mar 12, 2021

Migrating things punted by this PR to issues:

I think that might be all?

@bzinberg
Copy link
Contributor

Just built and pushed the new image as probcomp/gen-quickstart:2021-03-23.001.

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.

None yet

3 participants