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

PAYARA-3314 Add Concept of Docker Nodes (Tech Preview) #3952

Merged
merged 13 commits into from May 20, 2019

Conversation

Projects
None yet
3 participants
@Pandrex247
Copy link
Member

commented May 15, 2019

Adds the concept of a Docker Node to Payara Server.

A Docker Node is a representation of a physical machine onto which docker containers will be spawned, inside of which will reside a Payara Server instance. These instances should function as "standard" remote instances, they simply exist within a docker container.

Each node is tied to a specific Docker image, so if you would like to run different images on the same machine, you will need to create multiple nodes for it.

As the underlying communication mechanism with Docker is done via the REST API, you will need to expose the docker port to HTTP. A guide on securing this exposed port can be found here: https://docs.docker.com/engine/security/https/.
If following this linked guide, you will then need to: configure the node to use TLS (configurable attribute); add the CA pem to the Payara Server cacerts; create a pkcs bundle of the client cert and key; add the pkcs bundle to the Payara Server keystore.

Several new asadmin commands have been added, but efforts have been made to keep them as similar in functionality to the existing ones (e.g. start-instance will start the Docker container and the instance within it)

A default docker image has been created (still needs publishing), but the option is available to provide a custom one - it must however roughly conform to the default image.

Configuration of the Docker containers is also available, and is done using system properties. This allows you to specify them in a config, and override them at the instance level as desired. Configuration options can be found in the Docker Rest API: https://docs.docker.com/engine/api/v1.39/#operation/ContainerCreate. These Json properties match to system properties in the following format:

  • All options must be prefixed with Docker
  • Nested options follow the dotted name format used by system properties (e.g. to configure { HostConfig { Memory : 0 } } the equivalent system property would be Docker.HostConfig.Memory=0
  • Values of array must be surrounded with [], the split operator is |, and the split operator for any objects within the array is , (e.g. to configure { HostConfig { Mounts [ {Type: Bind, Source: /foo/bar, Target: /opt/foo, ReadOnly: true}, {Type: Bind, Source: /bar/foo, Target: /foo/opt, ReadOnly: true} ] } } the equivalent system property would be Docker.HostConfig.Mounts=[Type:Bind,Source:/foo/bar,Target:/opt/foo,ReadOnly:true|Type:Bind,Source:/bar/foo,Target:/foo/opt,ReadOnly:true]
  • Due to a low-level restriction of not having = in the value of a system property, it is replaced with :, which means configuration of { Env: [ foo=bar ] } would look like so: Docker.Env=[foo:bar]

@Pandrex247 Pandrex247 added this to the 5.192 milestone May 15, 2019

@pdudits
Copy link
Contributor

left a comment

In first pass I was just reading the code. In next pass I'll try to run it...

@rdebusscher

This comment has been minimized.

Copy link
Contributor

commented May 16, 2019

The Web Admin console screen info text for "Node Host" doesn't mention that it is required for DOCKER type. But when not filled in, a validation popup is shown.

@Pandrex247

This comment has been minimized.

Copy link
Member Author

commented May 17, 2019

@pdudits Added a few tests for the Json construction.

@Pandrex247 Pandrex247 marked this pull request as ready for review May 20, 2019

@Pandrex247

This comment has been minimized.

Copy link
Member Author

commented May 20, 2019

Jenkins test please

@Pandrex247 Pandrex247 merged commit c9c7a92 into payara:master May 20, 2019

59 checks passed

Payara Quick Build and Test Quick build and test passed!
Details
security/snyk - api/payara-api/pom.xml (payara-ci) No new issues
Details
security/snyk - api/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/admin/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/admingui/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/ant-tasks/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/appclient/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/batch/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/common/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/concurrent/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/connectors/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/core/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/deployment/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/distributions/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/ejb/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/extras/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/featuresets/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/flashlight/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/grizzly/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/ha/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/installer/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/javaee-api/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/jdbc/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/jms/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/load-balancer/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/orb/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/osgi-platforms/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/packager/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/payara-appserver-modules/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/persistence/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/registration/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/resources/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/security/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/tests/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/transaction/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/web/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/webservices/pom.xml (payara-ci) No new issues
Details
security/snyk - copyright/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/admin/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/cluster/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/common/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/core/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/deployment/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/diagnostics/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/distributions/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/flashlight/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/grizzly/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/hk2/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/osgi-platforms/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/packager/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/payara-modules/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/resources-l10n/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/resources/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/security/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/test-utils/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/tests/pom.xml (payara-ci) No new issues
Details
security/snyk - pom.xml (payara-ci) No new issues
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.