{"id":23404801,"url":"https://github.com/spirals-team/docker-g5k","last_synced_at":"2025-08-24T20:30:27.318Z","repository":{"id":57528488,"uuid":"71116827","full_name":"Spirals-Team/docker-g5k","owner":"Spirals-Team","description":"Docker Grid5000 client (CLI and Go library)","archived":false,"fork":false,"pushed_at":"2017-07-04T13:41:07.000Z","size":125,"stargazers_count":13,"open_issues_count":1,"forks_count":2,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-06-20T13:31:09.308Z","etag":null,"topics":["docker","docker-machine","docker-swarm","g5k","grid5000","inria"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Spirals-Team.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-17T08:35:06.000Z","updated_at":"2023-06-08T20:57:28.000Z","dependencies_parsed_at":"2022-08-30T11:51:00.169Z","dependency_job_id":null,"html_url":"https://github.com/Spirals-Team/docker-g5k","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Spirals-Team%2Fdocker-g5k","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Spirals-Team%2Fdocker-g5k/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Spirals-Team%2Fdocker-g5k/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Spirals-Team%2Fdocker-g5k/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Spirals-Team","download_url":"https://codeload.github.com/Spirals-Team/docker-g5k/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230832726,"owners_count":18287091,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-machine","docker-swarm","g5k","grid5000","inria"],"created_at":"2024-12-22T13:15:47.795Z","updated_at":"2024-12-22T13:15:48.324Z","avatar_url":"https://github.com/Spirals-Team.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/Spirals-Team/docker-g5k.svg)](https://travis-ci.org/Spirals-Team/docker-g5k)\n\n# docker-g5k\nA tool to create a Docker Swarm cluster for Docker Machine on the Grid5000 testbed infrastructure.  \n\n## Requirements\n* [Docker](https://www.docker.com/products/overview#/install_the_platform)\n* [Docker Machine](https://docs.docker.com/machine/install-machine)\n* [Docker Machine Driver for Grid5000 (v1.6.1+)](https://github.com/Spirals-Team/docker-machine-driver-g5k)\n* [Go tools (Only for installation from sources)](https://golang.org/doc/install)\n\nYou need a Grid5000 account to use this tool. See [this page](https://www.grid5000.fr/mediawiki/index.php/Grid5000:Get_an_account) to create an account.\n\n## VPN\n**You need to be connected to the Grid5000 VPN to create and access your Docker nodes.**  \n**Do not forget to configure your DNS or use OpenVPN DNS auto-configuration.**  \n**Please follow the instructions from the [Grid5000 Wiki](https://www.grid5000.fr/mediawiki/index.php/VPN).**\n\n## Installation\n\n## Installation from GitHub releases\nBinary releases for Linux, MacOS and Windows using x86/x86_64 CPU architectures are available in the [releases page](https://github.com/Spirals-Team/docker-g5k/releases).  \nYou can use the following commands to install or upgrade the tool:\n```bash\n# download the binary for your OS and CPU architecture :\nsudo curl -L -o /usr/local/bin/docker-g5k \"\u003clink to release\u003e\"\n\n# grant execution rigths for everyone :\nsudo chmod 755 /usr/local/bin/docker-g5k\n```\n\n## Installation from sources\n*This procedure was only tested on Ubuntu 16.04 and Fedora 25*\n\nTo use the Go tools, you need to set your [GOPATH](https://golang.org/doc/code.html#GOPATH) variable environment.  \nTo get the code and compile the binary, run:\n```bash\ngo get -u github.com/Spirals-Team/docker-g5k\n```\n\nThen, either put the 'docker-g5k' binary in a directory filled in your PATH environment variable, or run:\n```bash\nexport PATH=$PATH:$GOPATH/bin\n```\n\n## How to use\n\n### Command line flags\nFlags marked with `[ ]` can be given multiple times and the values will be added.\n\nFlags marked with `{ }` support brace expansion (same format as sh/bash shells) to generate combinations.  \nPlease refer to the flags format in \"Flags usage\" section of the command.\n\n#### For `create-cluster` command\n\n##### Flags description\n* **`--g5k-username` : Your Grid5000 account username (required)**\n* **`--g5k-password` : Your Grid5000 account password (required)**\n* **`--g5k-reserve-nodes` : Reserve nodes on a site (required)**\n* `--g5k-walltime` : Timelife of the nodes (format: \"hh:mm:ss\")\n* `--g5k-image` : Name of the image to deploy on the nodes\n* `--g5k-resource-properties` :  Resource selection with OAR properties (SQL format)\n* `--engine-install-url` : Custom URL to use for Docker engine installation\n* `--engine-opt` : Specify flags to include on the selected node(s) engine\n* `--engine-label` : Specify labels for the selected node(s) engine\n* `--swarm-master` : Select node(s) to be promoted to Swarm Master\n* `--swarm-mode-enable` : Create a Swarm mode cluster\n* `--swarm-standalone-enable` : Create a Swarm standalone cluster\n* `--swarm-standalone-discovery` : Discovery service to use with Swarm\n* `--swarm-standalone-image` : Specify the Docker image to use for Swarm\n* `--swarm-standalone-strategy` : Define a default scheduling strategy for Swarm\n* `--swarm-standalone-opt` : Define arbitrary global flags for Swarm master\n* `--swarm-standalone-join-opt` : Define arbitrary global flags for Swarm join\n* `--weave-networking` : Use Weave for networking (Only with Swarm standalone)\n\n##### Flags usage\n|             Option             |          Environment         |       Default value       | { } | [ ] |\n|--------------------------------|------------------------------|---------------------------|-----|-----|\n| `--g5k-username`               | `G5K_USERNAME`               |                           | No  | No  |\n| `--g5k-password`               | `G5K_PASSWORD`               |                           | No  | No  |\n| `--g5k-reserve-nodes`          | `G5K_RESERVE_NODES`          |                           | Yes | Yes |\n| `--g5k-walltime`               | `G5K_WALLTIME`               | \"1:00:00\"                 | No  | No  |\n| `--g5k-image`                  | `G5K_IMAGE`                  | \"jessie-x64-min\"          | No  | No  |\n| `--g5k-resource-properties`    | `G5K_RESOURCE_PROPERTIES`    |                           | No  | No  |\n| `--engine-install-url`         | `ENGINE_INSTALL_URL`         | \"https://get.docker.com\"  | No  | No  |\n| `--engine-opt`                 | `ENGINE_OPT`                 |                           | Yes | Yes |\n| `--engine-label`               | `ENGINE_LABEL`               |                           | Yes | Yes |\n| `--swarm-master`               | `SWARM_MASTER`               |                           | Yes | Yes |\n| `--swarm-mode-enable`          | `SWARM_MODE_ENABLE`          |                           | No  | No  |\n| `--swarm-standalone-enable`    | `SWARM_STANDALONE_ENABLE`    |                           | No  | No  |\n| `--swarm-standalone-discovery` | `SWARM_STANDALONE_DISCOVERY` | Deploy a local ZooKeeper  | No  | No  |\n| `--swarm-standalone-image`     | `SWARM_STANDALONE_IMAGE`     | \"swarm:latest\"            | No  | No  |\n| `--swarm-standalone-strategy`  | `SWARM_STANDALONE_STRATEGY`  | \"spread\"                  | No  | No  |\n| `--swarm-standalone-opt`       | `SWARM_STANDALONE_OPT`       |                           | No  | Yes |\n| `--swarm-standalone-join-opt`  | `SWARM_STANDALONE_JOIN_OPT`  |                           | No  | Yes |\n| `--weave-networking`           | `WEAVE_NETWORKING`           |                           | No  | No  |\n\nFlag `--g5k-reserve-nodes` format is `site:numberOfNodes` and brace expansion are supported.  \nFor example, `lille-16`, `{lille,nantes}-16`.\n\nEngine flags `--engine-opt` and `--engine-label` format is `node-name:key=val` and brace expansion are supported.  \nFor example, `lille-0:mykey=myval`, `lille-{0..5}:mykey=myval`, `lille-{0,2,4}:mykey=myval`.  \n\nFor `--engine-opt` flag, please refer to [Docker documentation](https://docs.docker.com/engine/reference/commandline/dockerd/) for supported parameters.  \n**Test your parameters on a single node before deploying a cluster ! If your flags are incorrect, Docker wont start and you should redeploy the entire cluster !**\n\n#### For `list-cluster` command\nThis command does not take any arguments, and will print jobs reservations in the following form:\n\n```bash\nJOB ID    NUMBER OF MACHINE(S)   MACHINE(S) NAME\n111111    3                      luxembourg-0, luxembourg-1, luxembourg-2\n222222    5                      lyon-0, lyon-1, lyon-2, lyon-3, lyon-4\n333333    1                      test-lille\n```\n\n#### For `remove-cluster` command\n\n##### Flags description\n* `--no-confirm` : Disable confirmation before removing machines\n\n##### Flags usage\n|             Option             |          Environment         |     Default value     | { } | [ ] |\n|--------------------------------|------------------------------|-----------------------|-----|-----|\n| `--no-confirm`                 | `G5K_RM_NO_CONFIRM`          | False                 | No  | Yes |\n\n### Examples\n\n#### Cluster creation\n\nAn example of a 16 nodes Docker reservation (Only Docker, Swarm is not configured):\n```bash\ndocker-g5k create-cluster \\\n--g5k-username \"user\" \\\n--g5k-password \"********\" \\\n--g5k-reserve-nodes \"lille:16\" \\\n```\n\nAn example of a 16 nodes Docker reservation with Engine options and labels:\n```bash\ndocker-g5k create-cluster \\\n--g5k-username \"user\" \\\n--g5k-password \"********\" \\\n--g5k-reserve-nodes \"lille:16\" \\\n--engine-opt \"lille-{0..15}:graph=/tmp\" \\\n--engine-label \"lille-0:mylabelname1=mylabelvalue1\" \\\n--engine-label \"lille-{1..5}:mylabelname2=mylabelvalue2\"\n```\n\nAn example of a 16 nodes Docker reservation using resource properties (nodes with more thant 8GB of RAM and at least 4 CPU cores):\n```bash\ndocker-g5k create-cluster \\\n--g5k-username \"user\" \\\n--g5k-password \"********\" \\\n--g5k-reserve-nodes \"lille:16\" \\\n--g5k-resource-properties \"memnode \u003e 8192 and cpucore \u003e= 4\"\n```\n\nAn example of multi-sites cluster creation:\n```bash\ndocker-g5k create-cluster \\\n--g5k-username \"user\" \\\n--g5k-password \"********\" \\\n--g5k-reserve-nodes \"lille:16\" \\\n--g5k-reserve-nodes \"nantes:8\"\n```\n\nAn example of multi-sites cluster creation using brace expansion:\n```bash\ndocker-g5k create-cluster \\\n--g5k-username \"user\" \\\n--g5k-password \"********\" \\\n--g5k-reserve-nodes \"{lille,nantes}:16\"\n```\n\nAn example of a 16 nodes Docker Swarm mode cluster creation using the first 3 nodes as Swarm Master:\n```bash\ndocker-g5k create-cluster \\\n--g5k-username \"user\" \\\n--g5k-password \"********\" \\\n--g5k-reserve-nodes \"lille:16\" \\\n--swarm-mode-enable \\\n--swarm-master \"lille-{0..2}\"\n```\n\nAn example of a 16 nodes Docker Swarm standalone cluster creation using the first node as Swarm Master and Weave Networking:\n```bash\ndocker-g5k create-cluster \\\n--g5k-username \"user\" \\\n--g5k-password \"********\" \\\n--g5k-reserve-nodes \"lille:16\" \\\n--swarm-standalone-enable \\\n--swarm-master \"lille-0\" \\\n--weave-networking\n```\n\n#### Cluster deletion\n\nAn example of deleting only nodes related to a job ID:\n```bash\ndocker-g5k remove-cluster 1234\n```\n\nAn example of deleting only nodes related to a job ID without confirmation:\n```bash\ndocker-g5k remove-cluster --no-confirm 1234\n```\n\nAn example of multi-jobs deletion:\n```bash\ndocker-g5k remove-cluster 1234 5678 9012\n```\n\n#### Normal use\n\nAfter creating a cluster, you should be able to use it with usual Docker Machine commands.  \nBy example, to list all nodes in the cluster :\n```bash\ndocker-machine ls\n```\n\n**If you remove a node with Docker Machine 'rm' command, the job will be deleted and ALL nodes related to this job will become unavailable**  \n\n### Use with Weave networking (Only with Swarm standalone)\n\nFirst, you need to configure your Docker client to use the Swarm mode (You can get the Swarm master hostname with 'docker-machine ls'):\n```bash\neval $(docker-machine env --swarm swarm-master-node-name)\n```\n\nThen run a container using Weave networking:\n```bash\ndocker run --net=weave -h foo.weave.local --name foo --dns=172.17.0.1 --dns-search=weave.local. -td your-image:version\n```\nYour containers can now communicate with each other using theirs short ('foo') or long ('foo.weave.local') name.  \nThe name used NEED to be the one given in parameter '-h'. The name of the container (parameter '--name') is not used by Weave.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspirals-team%2Fdocker-g5k","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspirals-team%2Fdocker-g5k","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspirals-team%2Fdocker-g5k/lists"}