-
Notifications
You must be signed in to change notification settings - Fork 925
LIBCLOUD-781 Introducing Container-as-a-Service cloud as an API base driver to libcloud #666
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
Changes from all commits
a39ea88
ee814b6
ef18fbd
0dc5573
e982273
fe7ba5c
e61bad5
e7665f9
2450063
6d83dc0
8e749b5
6a4a772
f1674de
c8024ad
edb1265
69cd184
7c27da6
d51dd3d
c82230f
f4c1e2e
a1adaae
b64d2fa
5473771
0999e52
9507a63
4bde5af
57a0ca9
83c06fe
c247ea8
9274450
c5edd3a
8c01c62
c188d32
db7d8f0
f909e6b
0aec851
88390ae
c6a57a8
5e6b38f
3280fc3
5aa34e1
6e4df6d
223b517
104cdb1
d29629d
f00a9b7
621ec71
a3ed405
8537731
f3943ea
936fe42
0b87588
c8c6c2f
65bc1dd
a477303
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,6 @@ python: | |
| - 3.4 | ||
| - 3.5 | ||
| - "pypy" | ||
| sudo: false | ||
| os: | ||
| - linux | ||
| # Note: OS X has been broken on Travis for a long time | ||
|
|
@@ -17,15 +16,18 @@ env: | |
|
|
||
| matrix: | ||
| fast_finish: true | ||
| allow_failures: | ||
| - os: osx | ||
| include: | ||
| - python: 2.7 | ||
| - sudo: required | ||
| python: 2.7 | ||
| env: ENV=lint | ||
| before_script: TOX_ENV=lint | ||
| - python: 2.7 | ||
| - sudo: required | ||
| python: 2.7 | ||
| env: ENV=docs | ||
| before_script: TOX_ENV=docs-travis | ||
| before_install: | ||
| - sudo apt-get update -qq | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not 100% sure if that's the root cause, but lint and docs jobs / tasks seems to have started getting stuck (https://travis-ci.org/apache/libcloud see build history, current build is stuck as well) after this change was merged (first I thought it might be an issue with Travis). Will see if my change (17384ca) fixes that.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sadly I believe builds got stuck because "sudo: required" is not a valid syntax or something related to that.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can't figure out why the addons stuff is not working (I tried many different things) :/ It seems that it works for all the tasks except the docs one (https://travis-ci.org/apache/libcloud/jobs/104312529). I checked other projects and they use the same syntax and it works just fine for them. |
||
| - sudo apt-get install -y graphviz | ||
| # Trigger ReadTheDocs build | ||
| after_success: ./contrib/trigger_rtd_build.py 8284 | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,7 +44,7 @@ | |
| # Add any Sphinx extension module names here, as strings. They can be extensions | ||
| # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. | ||
| extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', | ||
| 'sphinx.ext.viewcode'] | ||
| 'sphinx.ext.viewcode', 'sphinx.ext.graphviz'] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice 👍 |
||
|
|
||
| # Add any paths that contain templates here, relative to this directory. | ||
| templates_path = ['_templates'] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| .. NOTE: This file has been generated automatically using generate_provider_feature_matrix_table.py script, don't manually edit it | ||
|
|
||
| =================================== ============= =========== ================ ============= =============== ============== ================= ================= =============== ============== ============== =============== ============= | ||
| Provider install image list images deploy container get container start container stop container restart container destroy container list containers list locations create cluster destroy cluster list clusters | ||
| =================================== ============= =========== ================ ============= =============== ============== ================= ================= =============== ============== ============== =============== ============= | ||
| `Docker`_ yes yes yes yes yes yes yes yes yes no no no no | ||
| `Amazon Elastic Container Service`_ no yes yes yes yes yes yes yes yes no yes yes yes | ||
| `Joyent Triton`_ yes yes yes yes yes yes yes yes yes no no no no | ||
| `Kubernetes`_ no no yes yes no no no yes yes no yes yes yes | ||
| =================================== ============= =========== ================ ============= =============== ============== ================= ================= =============== ============== ============== =============== ============= | ||
|
|
||
| .. _`Docker`: http://docker.io | ||
| .. _`Amazon Elastic Container Service`: https://aws.amazon.com/ecs/details/ | ||
| .. _`Joyent Triton`: http://joyent.com | ||
| .. _`Kubernetes`: http://kubernetes.io |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| .. NOTE: This file has been generated automatically using generate_provider_feature_matrix_table.py script, don't manually edit it | ||
|
|
||
| =================================== ============================================ ================= ============================================ ================================== | ||
| Provider Documentation Provider constant Module Class Name | ||
| =================================== ============================================ ================= ============================================ ================================== | ||
| `Docker`_ :doc:`Click </container/drivers/docker>` DOCKER :mod:`libcloud.container.drivers.docker` :class:`DockerContainerDriver` | ||
| `Amazon Elastic Container Service`_ :doc:`Click </container/drivers/ecs>` ECS :mod:`libcloud.container.drivers.ecs` :class:`ElasticContainerDriver` | ||
| `Joyent Triton`_ :doc:`Click </container/drivers/joyent>` JOYENT :mod:`libcloud.container.drivers.joyent` :class:`JoyentContainerDriver` | ||
| `Kubernetes`_ :doc:`Click </container/drivers/kubernetes>` KUBERNETES :mod:`libcloud.container.drivers.kubernetes` :class:`KubernetesContainerDriver` | ||
| =================================== ============================================ ================= ============================================ ================================== | ||
|
|
||
| .. _`Docker`: http://docker.io | ||
| .. _`Amazon Elastic Container Service`: https://aws.amazon.com/ecs/details/ | ||
| .. _`Joyent Triton`: http://joyent.com | ||
| .. _`Kubernetes`: http://kubernetes.io |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| :orphan: | ||
|
|
||
| Container Base API | ||
| ================== | ||
|
|
||
| .. autoclass:: libcloud.container.base.ContainerDriver | ||
| :members: | ||
|
|
||
| .. autoclass:: libcloud.container.base.Container | ||
| :members: | ||
|
|
||
| .. autoclass:: libcloud.container.base.ContainerImage | ||
| :members: | ||
|
|
||
| .. autoclass:: libcloud.container.base.ContainerCluster | ||
| :members: | ||
|
|
||
| .. autoclass:: libcloud.container.base.ClusterLocation | ||
| :members: |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| Docker Container Driver Documentation | ||
| ===================================== | ||
|
|
||
| `Docker`_ containers wrap up a piece of software in a complete filesystem that contains everything it needs to run: | ||
| code, runtime, system tools, system libraries – anything you can install on a server. This guarantees that it will always run the same, | ||
| regardless of the environment it is running in. | ||
|
|
||
| .. figure:: /_static/images/provider_logos/docker.png | ||
| :align: center | ||
| :width: 300 | ||
| :target: http://docker.io/ | ||
|
|
||
| Instantiating the driver | ||
| ------------------------ | ||
|
|
||
| .. literalinclude:: /examples/container/docker/instantiate_driver.py | ||
| :language: python | ||
|
|
||
| API Docs | ||
| -------- | ||
|
|
||
| .. autoclass:: libcloud.container.drivers.docker.DockerContainerDriver | ||
| :members: | ||
| :inherited-members: | ||
|
|
||
| .. _`Docker`: https://docker.io/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| Amazon Elastic Container Service Documentation | ||
| ============================================== | ||
|
|
||
| Elastic Container Service is a container-as-a-service feature of `AWS`_. | ||
|
|
||
| .. figure:: /_static/images/provider_logos/aws.png | ||
| :align: center | ||
| :width: 300 | ||
| :target: http://aws.amazon.com/ | ||
|
|
||
| To provide API key access, you should apply one of the roles: | ||
| * AmazonEC2ContainerServiceFullAccess | ||
| * AmazonEC2ContainerServiceReadOnlyAccess | ||
|
|
||
| Instantiating the driver | ||
| ------------------------ | ||
|
|
||
| .. literalinclude:: /examples/container/ecs/instantiate_driver.py | ||
| :language: python | ||
|
|
||
| Deploying a container | ||
| --------------------- | ||
|
|
||
| .. literalinclude:: /examples/container/ecs/deploy_container.py | ||
| :language: python | ||
|
|
||
| Deploying a container from Docker Hub | ||
| ------------------------------------- | ||
|
|
||
| Docker Hub Client :class:`~libcloud.container.utils.docker.HubClient` is a shared utility class for interfacing to the public Docker Hub Service. | ||
|
|
||
| You can use this class for fetching images to deploy to services like ECS | ||
|
|
||
| .. literalinclude:: /examples/container/docker_hub.py | ||
| :language: python | ||
|
|
||
| Deploying a container from Amazon Elastic Container Registry (ECR) | ||
| ------------------------------------------------------------------ | ||
|
|
||
| Amazon ECR is a combination of the Docker Registry V2 API and a proprietary API. The ECS driver includes methods for talking to both APIs. | ||
|
|
||
| Docker Registry API Client :class:`~libcloud.container.utils.docker.RegistryClient` is a shared utility class for interfacing to the public Docker Hub Service. | ||
|
|
||
| You can use a factory method to generate an instance of RegsitryClient from the ECS driver. This will request a 12 hour token from the Amazon API and instantiate a :class:`~libcloud.container.utils.docker.RegistryClient` | ||
| object with those credentials. | ||
|
|
||
| .. literalinclude:: /examples/container/ecs/container_registry.py | ||
| :language: python | ||
|
|
||
| API Docs | ||
| -------- | ||
|
|
||
| .. autoclass:: libcloud.container.drivers.ecs.ElasticContainerDriver | ||
| :members: | ||
| :inherited-members: | ||
|
|
||
|
|
||
| .. _`AWS`: https://aws.amazon.com/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| :orphan: | ||
|
|
||
| Container Drivers Documentation | ||
| =============================== | ||
|
|
||
| This chapter includes links to driver (provider) specific documentation pages. | ||
|
|
||
| .. toctree:: | ||
| :glob: | ||
| :maxdepth: 1 | ||
|
|
||
| * |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| Joyent Triton Container Driver Documentation | ||
| ============================================ | ||
|
|
||
| `Joyent Triton`_ is a Docker hosting service, provided by service provider Joyent. | ||
| Docker-native tools and elastic hosts make deploying on Triton as easy as running Docker on your laptop. | ||
| There is no special software to install or configure. | ||
| Mix Docker containers with container-native Linux to extend the benefits of containerization to legacy applications and stateful services. | ||
|
|
||
| .. figure:: /_static/images/provider_logos/triton.png | ||
| :align: center | ||
| :width: 300 | ||
| :target: http://joyent.com/ | ||
|
|
||
| Instantiating the driver | ||
| ------------------------ | ||
|
|
||
| Download the script:: | ||
|
|
||
| curl -O https://raw.githubusercontent.com/joyent/sdc-docker/master/tools/sdc-docker-setup.sh | ||
|
|
||
| Now execute the script, substituting the correct values:: | ||
|
|
||
| bash sdc-docker-setup.sh <CLOUDAPI_URL> <ACCOUNT_USERNAME> ~/.ssh/<PRIVATE_KEY_FILE> | ||
|
|
||
| This should output something similar to the following:: | ||
|
|
||
| Setting up Docker client for SDC using: | ||
| CloudAPI: https://us-east-1.api.joyent.com | ||
| Account: jill | ||
| Key: /Users/localuser/.ssh/sdc-docker.id_rsa | ||
|
|
||
| If you have a pass phrase on your key, the openssl command will | ||
| prompt you for your pass phrase now and again later. | ||
|
|
||
| Verifying CloudAPI access. | ||
| CloudAPI access verified. | ||
|
|
||
| Generating client certificate from SSH private key. | ||
| writing RSA key | ||
| Wrote certificate files to /Users/localuser/.sdc/docker/jill | ||
|
|
||
| Get Docker host endpoint from cloudapi. | ||
| Docker service endpoint is: tcp://us-east-1.docker.joyent.com:2376 | ||
|
|
||
| * * * | ||
| Success. Set your environment as follows: | ||
|
|
||
| export DOCKER_CERT_PATH=/Users/localuser/.sdc/docker/jill | ||
| export DOCKER_HOST=tcp://us-east-1.docker.joyent.com:2376 | ||
| export DOCKER_CLIENT_TIMEOUT=300 | ||
| export DOCKER_TLS_VERIFY=1 | ||
|
|
||
| .. literalinclude:: /examples/container/joyent/instantiate_driver.py | ||
| :language: python | ||
|
|
||
| API Docs | ||
| -------- | ||
|
|
||
| .. autoclass:: libcloud.container.drivers.joyent.JoyentContainerDriver | ||
| :members: | ||
| :inherited-members: | ||
|
|
||
|
|
||
| .. _`Joyent Triton`: https://www.joyent.com/blog/understanding-triton-containers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I missed this change.
You use sudo bellow so even if the sudo attribute is removed, it will still result in using legacy (non container) Travis CI infrastructure.
I think they added support for installing debian packages which still allows you to use new container based infrastructure. I will look into it.