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

[FLINK-3155] Update docker flink container to the latest release #2340

Closed
wants to merge 5 commits into from

Conversation

iemejia
Copy link
Member

@iemejia iemejia commented Aug 7, 2016

Thanks for contributing to Apache Flink. Before you open your pull request, please take the following check list into consideration.
If your changes take all of the items into account, feel free to open your pull request. For more information and/or questions please refer to the How To Contribute guide.
In addition to going through the list, please provide a meaningful description of your changes.

  • General
    • The pull request references the related JIRA issue ("[FLINK-XXX] Jira title text")
    • The pull request addresses only one issue
    • Each commit in the PR has a meaningful commit message (including the JIRA id)
  • Documentation
    • Documentation has been added for new functionality
    • Old documentation affected by the pull request has been updated
    • JavaDoc for public methods has been added
  • Tests & Build
    • Functionality added by the pull request is covered by tests
    • mvn clean verify has been executed successfully locally or a Travis build has passed

I also simplified some stuff from the basic script
@iemejia
Copy link
Member Author

iemejia commented Aug 7, 2016

I referred to the older FLINK issue since this is something we need to still improve. I can try to fix it in a subsequent PR, do you have any hints of how can we achieve this ?

R: @aljoscha or @mxm

@iemejia
Copy link
Member Author

iemejia commented Aug 7, 2016

(notice than when I said need to improve I refer at the missing automation to change the default release version on the Dockerfile).

@iemejia
Copy link
Member Author

iemejia commented Aug 7, 2016

I added two additional changes, an extra security fix (default user is not root now) and I changed the path to the more appropriate /opt.
Now this should be ready for review/merge.

tar xvz -C /usr/local/ && \
ln -s /usr/local/flink-$FLINK_VERSION /usr/local/flink && \
sed -i -e "s/echo \$mypid >> \$pid/echo \$mypid >> \$pid \&\& wait/g" /usr/local/flink/bin/flink-daemon.sh && \
curl -s https://archive.apache.org/dist/flink/flink-$FLINK_VERSION/flink-$FLINK_VERSION-bin-hadoop$HADOOP_VERSION-scala_$SCALA_VERSION.tgz | \
Copy link
Contributor

Choose a reason for hiding this comment

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

The use of the archive mirror is discouraged. It's better to use the load balancing script which you removed above.

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 agree, I just changed it because I find the older code so ugly (and fragile) for what it does, also my other argument to do this was the fact that people will probably won't build the image as much as they will pull it from the official hub.docker image (once we publish this image as the official one). I can let it like it was if this is better for you.

Copy link
Member Author

Choose a reason for hiding this comment

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

Notice that I have another argument against the mirrors and it is the security issue, imagine that a malign mirror puts a wrong version of flink, I wonder what is the recomended approach to validate this case (of course notice that I asume that hacking apache would be harder).

Copy link
Contributor

Choose a reason for hiding this comment

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

I see your point concerning fragility. You're probably right. Btw, you can always validate the download using the MD5/SHA256 files from the archive server :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Still would like to keep it because it is strongly encouraged to not use the load balanced servers instead of the archive server.

@mxm
Copy link
Contributor

mxm commented Aug 10, 2016

Thanks for the PR! It would be nice to have the install path configurable. Also, we should use ASF's load balancing script for downloading the binaries.

@iemejia
Copy link
Member Author

iemejia commented Aug 10, 2016

We should maybe wait for 1.1.1 to be up before doing this merge, I will add the commit for this and probably rebase everything once it is ready. Is it ok ?

@iemejia
Copy link
Member Author

iemejia commented Aug 11, 2016

@mxm this should be ready now.

@mxm
Copy link
Contributor

mxm commented Aug 11, 2016

Thanks! Looks good. Did you run the changes with Docker?

@iemejia
Copy link
Member Author

iemejia commented Aug 11, 2016

Of course, who do you think I am :P

You can check a ready to run build here in case you don't want to test that one. But it is true that we need some kind of automatized tests for the image.

https://hub.docker.com/r/iemejia/flink/

@iemejia
Copy link
Member Author

iemejia commented Aug 11, 2016

And remember that my ultimate goal is not to host that image but that we can convert it into an official one.

tar xvz -C /usr/local/ && \
ln -s /usr/local/flink-$FLINK_VERSION /usr/local/flink && \
sed -i -e "s/echo \$mypid >> \$pid/echo \$mypid >> \$pid \&\& wait/g" /usr/local/flink/bin/flink-daemon.sh && \
curl -s $(curl -s https://www.apache.org/dyn/closer.cgi\?preferred\=true)flink/flink-${FLINK_VERSION}/flink-${FLINK_VERSION}-bin-hadoop${HADOOP_VERSION}-scala_${SCALA_VERSION}.tgz | \
Copy link
Contributor

Choose a reason for hiding this comment

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

Much better! Thanks :)

@mxm
Copy link
Contributor

mxm commented Aug 17, 2016

Thanks for addressing my comments! Looks very good. I'm sorry I asked whether you have tested the changes. It may seem natural to you but trust me that is not always the case :)

Merging...

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.

4 participants