Arquillian Cube Extension 1.0.0.Alpha1 Released
Since we wrote this post we didn't laze around. Check our latest announcement.
The Arquillian team is proud to announce the 1.0.0.Alpha1 release of the Arquillian Cube Extension component!
Have a little control freak inside? Need to control it all?
Resistance is futile, all bugs will be assimilated!
What is Arquillian Cube?
With Arquillian Cube you can control the lifecycle of Docker images as part of the test lifecyle, either automatically or manually.
This gives you the chance to scale up from a integration/functional test level all the way up to the system test level.
It’s was named Cube simply because:
- Docker is like a cube
- The Borg starship is named a cube and because we are moving tests close to production we can say that “resistance is futile, all bugs will be assimilated”.
How does it work?
Arquillian Cube communicates with the Docker server via its remote REST API. You can build/create/start/stop/remove Docker instances with all the normal Docker features you’re used to.
Arquillian Cube Docker currently require the Docker server to run with TCP communication enabled. Read the preliminaries for detail information on how to set it up. Unix Socket support will be added in a later version.
What’s included in the Alpha1 release?
- Pulling images from custom repository
- Building images as part of test lifecycle
- Integration with Arquillian Container
Details
Pulling images
By default, when you refer to a Docker image by it’s id, Cube will use the official registry.hub.docker.com registry to look for images.
If you’re running your own Docker registry, either locally or remote, you can reconfigure Cube to use that one instead via the dockerRegistry
configuration option.
<extension qualifier="docker">
<property name="dockerRegistry">http://my-internal-registry.company.com</property>
</extension>
Cube Configuration
You can configure the individual Cubes in two different ways.
Either you can include a yaml snippet in the arquillian.xml
configuration element dockerContainers
;
<extension qualifier="docker">
<property name="dockerContainers">
tomcat:
image: tutum/tomcat:7.0
exposedPorts: [8089/tcp]
portBindings:
- exposedPort: 8089/tcp
port: 8089
</property>
</extension>
Or you can refer to an external file via dockerContainersFile
.
<extension qualifier="docker">
<property name="dockerContainersFile">src/test/resources/cubes.yaml</property>
</extension>
tomcat:
image: tutum/tomcat:7.0
exposedPorts: [8089/tcp]
portBindings:
- exposedPort: 8089/tcp
port: 8089
For a more complete overview of the configuration options please refer to the documentation.
Building images
If you would like to build an Docker image as part of the test as oppose to just consume a preexisting one you can refer to a directory with a DockerFile directly in the Cube configuration.
tomcat:
buildImage:
dockerfileLocation: src/test/resources/tomcat
noCache: true
remove: true
exposedPorts: [8089/tcp]
portBindings:
- exposedPort: 8089/tcp
port: 8089
For more information on building please refer to the documentation.
Arquillian Container
Not only can you control the Docker images, Cube also integrates nicely with the normal Arquillian Remote Containers.
When a Arquillian Container has the same qualifier as a Docker image, Cube will assume that the Docker image contains the Container and control the Image in the same lifecycle as the Container it self. Starting it before BeforeStart
and stopping it after AfterStop
.
There are two potential problem areas when using Arquillian Remote Containers with Docker images;
Docker by default boot up images on ‘random’ IP addresses and the Container it self might be bound to 127.0.0.1 inside the Docker container and skew any management API responses that will effect it’s ability to do deployments, in-container testing and URL injection.
Arquillian Cube address these issues by automatically remapping and updating the Container configuration and the metadata returned by the Container. In the end, all you need to do is define the Docker image and the Arquillian Container with the same name and place the Remote adapter on classpath.
<extension qualifier="docker"> <property name="dockerContainers"> tomcat: image: tutum/tomcat:7.0 exposedPorts: [8089/tcp] portBindings: - exposedPort: 8089/tcp port: 8089 </property> </extension>
<container qualifier="tomcat"> </container>
Documentation
For more information on how this all work, what you can configure etc please see the complete documentation
What’s coming next?
Next up for Cube is OpenShift 3/Kubernetes support. This should allow you to control images deployed on OpenShift Origin and not just via the normal Docker Server. Using the same implementation we hope to support Google Cloud Engine as well.
If you have any questions, problems or request: please drop us a note on the community forums.
What is Arquillian Cube Extension?
With Arquillian Cube you can control the lifecycle of Docker images as part of the test lifecyle, either automatically or manually. This gives you the chance to scale up from a integration/functional test level all the way up to the system test level.
Release details
Component | Arquillian Cube Extension |
---|---|
Version | 1.0.0.Alpha1 view tag |
Release date | 2014-11-15 |
Released by | Aslak Knutsen |
Compiled against |
Published artifacts org.arquillian.cube
- org.arquillian.cube » arquillian-cube-api jar javadoc pom
- org.arquillian.cube » arquillian-cube-spi jar javadoc pom
- org.arquillian.cube » arquillian-cube-docker jar javadoc pom
Release notes and resolved issues 21
- Enhancement
-
- #32 Support extension of Docker Image configuration
- #29 Create CubeController API
- #28 Create an enricher for injecting cube id in test
- #23 Change return type when creating a container.
- #19 Create Cube Command SPI events
- #18 Create Cube Lifecycle SPI events
- #17 Automatically configure default ports of Container incase of port forward
- #15 Support Docker Containers that are controlled out side an Arquillian Container
- #7 Adds log messages
- #6 Allow configure repository from where docker images are pulled
- #5 Add support for "docker pull image"
- #3 Users should be able to orchestrate more than one Docker container
- #2 Create Docker container from Dockerfile
- #1 Configuration parameters should be injectable as Arquillian Resource
- Bug
-
- #25 Rename groupIds to org.arquillian.extension
- #21 Update the ProtocolMetaData with the GateWay IP
- #16 Change @Cube enricher to @ArquillianResource
- #12 ProtocolMetaData returned by Container is wrong when using PortForwarding
- #10 Cube is using wrong port when doing port await check when portforward is enabled
- #8 Fails to build ftest
- #4 Handle Docker service not running with TCP enabled
Thanks to the following list of contributors: Alex Soto, Aslak Knutsen, Stefan Miklosovic