From 6bcfd6a9585008983e800025ea01bc1cf26ea857 Mon Sep 17 00:00:00 2001 From: Franz Garcia Date: Mon, 15 May 2017 11:04:02 -0400 Subject: [PATCH 1/8] MC-5244: Added changes to have resizable root volume --- cloudca.go | 11 +++++++++++ glide.lock | 8 ++++---- glide.yaml | 1 + 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/cloudca.go b/cloudca.go index a76453a..fa61b9e 100644 --- a/cloudca.go +++ b/cloudca.go @@ -91,6 +91,7 @@ type Driver struct { MemoryInMb string NetworkId string VpcId string + RootDiskSizeInGb string AdditionalDiskOfferingId string AdditionalDiskSizeGb string AdditionalDiskIops string @@ -142,6 +143,11 @@ func (d *Driver) GetCreateFlags() []mcnflag.Flag { Usage: "cloud.ca memory in MB for custom compute offerings", EnvVar: "CLOUDCA_MEMORY_MB", }, + mcnflag.StringFlag{ + Name: "cloudca-root-disk-size-in-gb", + Usage: "cloud.ca root disk size in GB (for resizable templates)", + EnvVar: "CLOUDCA_ROOT_DISK_SIZE_GB", + }, mcnflag.StringFlag{ Name: "cloudca-additional-disk-offering", Usage: "cloud.ca additional disk offering name or ID to attach to the machine", @@ -222,6 +228,7 @@ func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error { } d.CpuCount = flags.String("cloudca-cpu-count") d.MemoryInMb = flags.String("cloudca-memory-mb") + d.RootDiskSizeInGb = flags.String("cloudca-root-disk-size-in-gb") if err := d.setNetwork(flags.String("cloudca-network-id")); err != nil { return err @@ -382,6 +389,10 @@ func (d *Driver) Create() error { memory, _ := strconv.Atoi(d.MemoryInMb) instanceToCreate.MemoryInMB = memory } + if d.RootDiskSizeInGb != "" { + rootDiskSizeInGb, _ := strconv.Atoi(d.RootDiskSizeInGb) + instanceToCreate.RootVolumeSizeInGb = rootDiskSizeInGb + } if d.AdditionalDiskOfferingId != "" { instanceToCreate.UserData = userDataToMountVolume instanceToCreate.AdditionalDiskOfferingId = d.AdditionalDiskOfferingId diff --git a/glide.lock b/glide.lock index 652f098..496e8d2 100644 --- a/glide.lock +++ b/glide.lock @@ -1,8 +1,8 @@ -hash: 9c4a7f399e81ca9ffdbaf82626bea9668eb3c8d025b63110c39088640f9f4b7f -updated: 2017-04-11T11:08:15.061208815-04:00 +hash: 4b8425d2a5b7b3c56cf730430376f027fd48024bedd4c86e92d70ab0301bff4d +updated: 2017-05-11T14:31:04.10302672-04:00 imports: - name: github.com/cloud-ca/go-cloudca - version: 04ff238f38fb6774027017b5b4445566b06762c2 + version: f04a8140725fbded4ec411fd1e857a96c2e9a00f subpackages: - api - configuration @@ -13,7 +13,7 @@ imports: subpackages: - pkg/term - name: github.com/docker/machine - version: 15fd4c70403bab784d91031af02d9e169ce66412 + version: 5b274558ea6ca822c06dd407a4e774a0105c3f60 subpackages: - libmachine/drivers - libmachine/drivers/plugin diff --git a/glide.yaml b/glide.yaml index 7c59924..6b78191 100644 --- a/glide.yaml +++ b/glide.yaml @@ -1,6 +1,7 @@ package: github.com/cloud-ca/docker-machine-driver-cloudca import: - package: github.com/cloud-ca/go-cloudca + version: f04a8140725fbded4ec411fd1e857a96c2e9a00f subpackages: - services/cloudca - package: github.com/docker/machine From 11d70624020bbe2de053c6ec635ffa1d464e409f Mon Sep 17 00:00:00 2001 From: Franz-Philippe Garcia Date: Wed, 24 May 2017 13:22:35 -0400 Subject: [PATCH 2/8] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 61e5a62..51a1b8e 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ docker-machine create -d cloudca \ |``--cloudca-template`` |``CLOUDCA_TEMPLATE`` |cloud.ca template name or ID |none |yes| |``--cloudca-compute-offering``|``CLOUDCA_COMPUTE_OFFERING``|cloud.ca compute offering name or ID|none |yes| |``--cloudca-network-id`` |``CLOUDCA_NETWORK_ID`` |cloud.ca network ID (where the machine will be deployed)|none |yes| +|``--cloudca-root-disk-size-in-gb`` |``CLOUDCA_ROOT_DISK_SIZE_IN_GB`` |cloud.ca root disk size in gb (for resizable templates) |size defined by template |no| |``--cloudca-additional-disk-offering``|``CLOUDCA_ADDITIONAL_DISK_OFFERING``|cloud.ca additional disk offering name or ID to attach to the machine|none |no| |``--cloudca-use-private-ip`` |``CLOUDCA_USE_PRIVATE_IP`` |Use a private IP to access the machine|false |no| |``--cloudca-ssh-user`` |``CLOUDCA_SSH_USER`` |cloud.ca SSH user|cca-user|no| From 63b60bf968f7c4184c3a25ad8f145f6ca273afb6 Mon Sep 17 00:00:00 2001 From: Franz-Philippe Garcia Date: Wed, 24 May 2017 13:23:18 -0400 Subject: [PATCH 3/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 51a1b8e..ee9d09c 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ docker-machine create -d cloudca \ ``` **Notes:** * It is recommended to use Environment variables to store sensitive information like API keys. See the options below for the list of supported variables. -* The cloud.ca instances have limited disk space on their root volumes. In order to get more disk space for your Docker machines, use the `--cloudca-additional-disk-offering` option to specify an additional volume that Docker will be able to use. +* The cloud.ca instances have limited disk space on their root volumes. In order to get more disk space for your Docker machines, use the `--cloudca-root-disk-size-in-gb` if you have a resizable template or `--cloudca-additional-disk-offering` option to specify an additional volume that Docker will be able to use. ## Options From 172e3dba5f2bf3c77e2b458a244ec68e955ca15b Mon Sep 17 00:00:00 2001 From: Franz Garcia Date: Wed, 24 May 2017 13:25:34 -0400 Subject: [PATCH 4/8] MC-5244: PR fix --- cloudca.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cloudca.go b/cloudca.go index fa61b9e..a6a18ef 100644 --- a/cloudca.go +++ b/cloudca.go @@ -390,7 +390,10 @@ func (d *Driver) Create() error { instanceToCreate.MemoryInMB = memory } if d.RootDiskSizeInGb != "" { - rootDiskSizeInGb, _ := strconv.Atoi(d.RootDiskSizeInGb) + rootDiskSizeInGb, err := strconv.Atoi(d.RootDiskSizeInGb) + if err != nil { + return err + } instanceToCreate.RootVolumeSizeInGb = rootDiskSizeInGb } if d.AdditionalDiskOfferingId != "" { From 0b57e271977f487cfea19b13352e48f10a78ea1b Mon Sep 17 00:00:00 2001 From: Franz Garcia Date: Thu, 25 May 2017 11:12:58 -0400 Subject: [PATCH 5/8] MC-5244: Modified glide.yam --- glide.lock | 6 +++--- glide.yaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/glide.lock b/glide.lock index 496e8d2..599f397 100644 --- a/glide.lock +++ b/glide.lock @@ -1,8 +1,8 @@ -hash: 4b8425d2a5b7b3c56cf730430376f027fd48024bedd4c86e92d70ab0301bff4d -updated: 2017-05-11T14:31:04.10302672-04:00 +hash: e6b7f090140e81c7f6928331734c4dff8a3b3c3287f2f7973fab6f4eae92631c +updated: 2017-05-24T16:45:21.478919549-04:00 imports: - name: github.com/cloud-ca/go-cloudca - version: f04a8140725fbded4ec411fd1e857a96c2e9a00f + version: 21039f5a4375cdebddde9c7a0121ca6b5f56babb subpackages: - api - configuration diff --git a/glide.yaml b/glide.yaml index 6b78191..66f6e31 100644 --- a/glide.yaml +++ b/glide.yaml @@ -1,7 +1,7 @@ package: github.com/cloud-ca/docker-machine-driver-cloudca import: - package: github.com/cloud-ca/go-cloudca - version: f04a8140725fbded4ec411fd1e857a96c2e9a00f + version: v1.0.1 subpackages: - services/cloudca - package: github.com/docker/machine From a4c42b9857d7922fcbcba6da508ac5aea5977639 Mon Sep 17 00:00:00 2001 From: Franz Garcia Date: Thu, 25 May 2017 13:19:10 -0400 Subject: [PATCH 6/8] MC-5244: Added make file --- Makefile | 14 +++++++++++++- release-notes.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100755 release-notes.sh diff --git a/Makefile b/Makefile index 7549503..306401a 100644 --- a/Makefile +++ b/Makefile @@ -35,5 +35,17 @@ build-all: clean clean: rm -rf dist bin/docker-machine-driver-cloudca - +upload: + rm -f ./dist/docker-machine-driver-cloudca_${VERSION}_SWIFTURLS ; + SWIFT_ACCOUNT=`swift stat | grep Account: | sed s/Account:// | tr -d '[:space:]'` ; \ + SWIFT_URL=https://objects-qc.cloud.ca/v1 ; \ + SWIFT_CONTAINER=docker-machine-driver-cloudca ; \ + for FILE in `ls ./dist | grep -i docker-machine.*\.zip` ; do \ + echo "Uploading $$FILE to swift" ; \ + swift upload $${SWIFT_CONTAINER} ./dist/$$FILE --object-name ${VERSION}/$$FILE ; \ + echo "$${SWIFT_URL}/$${SWIFT_ACCOUNT}/$${SWIFT_CONTAINER}/${VERSION}/$$FILE" >> ./dist/docker-machine-driver-cloudca_${VERSION}_SWIFTURLS ; \ + done +release-notes: + ./release-notes.sh > ./dist/release.md ; +release: build-all upload release-notes .PHONY: init build install build-all clean diff --git a/release-notes.sh b/release-notes.sh new file mode 100755 index 0000000..cbfa8c1 --- /dev/null +++ b/release-notes.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +VERSION="$(git describe --tags)" +function getUrl() { + echo $(cat ./dist/docker-machine-driver-cloudca_${VERSION}_SWIFTURLS | grep $1) +} + +echo "[DESCRIPTION HERE] + +# Issues fixed +[ISSUES HERE] + +# Downloads + +**macOS** +- 64-bit: $(getUrl darwin) + +**Linux** +- 64-bit: $(getUrl linux-amd64) +- 32-bit: $(getUrl linux-386) +- Arm: $(getUrl linux-arm) + +**Windows** +- 64-bit: $(getUrl windows-amd64) +- 32-bit: $(getUrl windows-386) +" \ No newline at end of file From f7307e491c11395140bc93f67c57bad7f6e32f82 Mon Sep 17 00:00:00 2001 From: Franz-Philippe Garcia Date: Thu, 25 May 2017 13:24:07 -0400 Subject: [PATCH 7/8] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ee9d09c..1151ad2 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ docker-machine create -d cloudca \ --cloudca-template "Ubuntu 16.04.01 HVM" \ --cloudca-compute-offering "1vCPU.1GB" \ --cloudca-network-id "bbefe8dd-bb3e-4f37-b467-b63f8334c15b" \ + --cloudca-root-disk-size-in-gb "60" \ --cloudca-additional-disk-offering "50GB - 50 IOPS Min." \ test-machine1 ``` From 2fa01497adf0c4320ed285fed312a9f330f71799 Mon Sep 17 00:00:00 2001 From: Franz-Philippe Garcia Date: Thu, 25 May 2017 13:25:00 -0400 Subject: [PATCH 8/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1151ad2..59fc014 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ docker-machine create -d cloudca \ --cloudca-template "Ubuntu 16.04.01 HVM" \ --cloudca-compute-offering "1vCPU.1GB" \ --cloudca-network-id "bbefe8dd-bb3e-4f37-b467-b63f8334c15b" \ - --cloudca-root-disk-size-in-gb "60" \ + --cloudca-root-disk-size-in-gb 60 \ --cloudca-additional-disk-offering "50GB - 50 IOPS Min." \ test-machine1 ```