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

SAK-41868 Add Docker foundation #6967

Merged
merged 19 commits into from Jun 25, 2019
Merged

SAK-41868 Add Docker foundation #6967

merged 19 commits into from Jun 25, 2019

Conversation

dnhutchins
Copy link
Contributor

@dnhutchins dnhutchins commented May 29, 2019

Features

  • Developemnt stack examples
    • Staged development stack.
    • All data persisted locally in ./DATA
    • Shell-In-A-Box (browser console) maven image
    • Swarm stacks designed to be layered
      • Proxy + Sakai (No Search) + Mysql + Maven
      • Proxy + Sakai (No Search) + Mysql + Maven + PhpMyAdmin + MailCatcher
      • Proxy + Sakai (Search Enabled) + Mysql + Maven + PhpMyAdmin + MailCatcher + Cerebro + Kibana
      • Proxy + Sakai (Search Enabled) + Mysql + Maven + PhpMyAdmin + MailCatcher + Cerebro + Kibana + Graylog
  • Docker image building examples
    • Multiple build types:
    • From source
    • From binary release.
    • Automated via DockerHub
  • Docker Swarm deployment examples
    • Example Swarm stacks
      • Sakai + Mysql
      • Sakai + Mysql + Elasticsearch + Cerebro + Mailcatcher

@adrianfish adrianfish requested a review from jonespm May 29, 2019 10:01
@sakaiproject sakaiproject deleted a comment May 29, 2019
@jonespm
Copy link
Contributor

jonespm commented May 30, 2019

Hi David,

I was working on something similar to this but my use case was for local development and quick-start demos. https://github.com/sakaicontrib/docker-sakai-builder

It looks like yours is more targeted for production style deployment. Are you also coming to Open Apereo to present on this? Mine was a flash talk on building and starting Sakai in 7 minutes using this script. ;)

I should have time to review this, we could probably simplify it a little bit.

@dnhutchins
Copy link
Contributor Author

Hey Matthew,
I am coming to Open Apereo, and am presenting on this Mon @ 11:15. This isn't really intended to to target either development or production directly. But rather emphasize the point that using containers, there shouldn't really be much of a difference between the two.

Your comment points out that I should also include the "pre-built java" version of this Dockerfile, where you configure your local Maven to put the artifacts in a directory inside the same folder as the Dockerfile so the container can be built by COPY of the artifacts. (This is how we develop in our Vagrant environments at UVA)

While I did provide standalone docker examples of using the image, my focus is more on an example Docker Swarm stack. Which stems from having to talked to a lot of Docker enthusiasts (even a couple Docker Captains) that were basically unaware that Docker even had a fully functional built-in orchestration platform.

And lastly, the Dockerfiles in this PR are constructed so that they can be used from Docker Hub to facilitate automated image builds.

@dnhutchins
Copy link
Contributor Author

Great meeting and chatting with everyone at OA. And awesome lightening demo @jonespm !

I borrowed some of that concept and fleshed out a Docker Swarm development suite and added that here, and restructured things a bit into clear "dev" "build" and "deploy" sections.

@sakaiproject sakaiproject deleted a comment Jun 11, 2019
Codacy> Expressions don't expand in single quotes, use double quotes for that.
Me> That's because I do not want them to do that.. fine,, I'll escape it... better?
@dnhutchins
Copy link
Contributor Author

Okay, the last 3 issues from Codacy are all:
"Expressions don't expand in single quotes, use double quotes for that."

Which is exactly why I'm using single quotes, because I don't want that to expand..

Copy link
Contributor

@ern ern left a comment

Choose a reason for hiding this comment

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

We shouldn't include jar files directly in the repo should use a maven plugin to deploy them.
Same goes for the mysql connector (also there maybe license restrictions).

@dnhutchins
Copy link
Contributor Author

Okay, removed the jars and pull them from their respective repos in the container startup script.

@sakaiproject sakaiproject deleted a comment Jun 14, 2019
docker/deploy/config/sakai.properties Outdated Show resolved Hide resolved
Copy link
Contributor

@ern ern 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 other issues, would like to have Matt's review first before merging

@ern ern self-requested a review June 18, 2019 15:15
Copy link
Contributor

@jonespm jonespm left a comment

Choose a reason for hiding this comment

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

Yeah, this seems good. I can merge the work I've done which is somewhat independent of this to this directory after this is merged in. This seems more for production where-as what I was working on were basically like "aliases" for faster development. (Re-compile/deploy single modules)

A few minor improvements/future suggestions.

  • If you mvn install with -P mysql in Dockerfile.source it will download the latest MySQL connector so you don't have to do that later in Dockerfile.binary. (And it looks like you're also doing this in Dockerfile.source)

  • If you mvn install with the options -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -T C1 it builds about twice as fast.

  • Repeated versions and strings like MySQL version (5.1.47) should be an ARG so they're easier to change in future versions

  • A future release could use environment variables to make the builds a little more configurable (add a11y CKEditor, configure which options to deploy)

@ern ern changed the title SAK-41868 Add Docker examples SAK-41868 Add Docker foundation Jun 25, 2019
@ern
Copy link
Contributor

ern commented Jun 25, 2019

Lets create some JIRA's to get these improvements in.

@ern ern merged commit 79d1f81 into sakaiproject:master Jun 25, 2019
wyu12 pushed a commit to wyu12/sakai that referenced this pull request Jul 1, 2019
* SAK-41868 Add Docker examples

* SAK-41868 Implement codacy suggestions

* SAK-41868 Implement codacy suggestions for automated

* SAK-41868 Use secrets module for Sakai + Mysql example

* SAK-41868 Fix a port mapping

* SAK-41868 Add development examples, and restructure exmaples

* SAK-41868 Remove dnagling Vagrantfile

* SAK-41868 Fix css for codacy

* SAK-41868 Use generic local image in example

* SAK-41868 Tweaks from codacy

* SAK-41868 Tweaks from codacy

Codacy> Expressions don't expand in single quotes, use double quotes for that.
Me> That's because I do not want them to do that.. fine,, I'll escape it... better?

* SAK-41868 Tweaks from codacy, when all else fails.. escape all the things..

* Update README.md

* Update README.md

* SAK-41868 Remove static jars

* SAK-41868 Add an image builder example to dev context, fix a port mapping

* SAK-41868 Codacy tweaks

* SAK-41868 Clean up deployment example Sakai configuration

* SAK-41868 Use example Docker Secrets configuration for minimal stack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants