Skip to content

ContainerInfra: nodegroups Get #1774

Merged
jtopjian merged 5 commits intogophercloud:masterfrom
tghartland:nodegroups-get
Dec 11, 2019
Merged

ContainerInfra: nodegroups Get #1774
jtopjian merged 5 commits intogophercloud:masterfrom
tghartland:nodegroups-get

Conversation

@coveralls
Copy link
Copy Markdown

coveralls commented Nov 19, 2019

Coverage Status

Coverage increased (+0.04%) to 77.032% when pulling f17b169 on tghartland:nodegroups-get into 7aa2e52 on gophercloud:master.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Nov 19, 2019

Build succeeded.

@tghartland
Copy link
Copy Markdown
Contributor Author

I have added acceptance tests for Get/List, but in my devstack environment I had to make a change in the general cluster setup here

createOpts := clustertemplates.CreateOpts{

to add

three := 3
createOpts := clustertemplates.CreateOpts{ 
    DockerVolumeSize := &three,

otherwise I would get the error

Failure in nodegroups_test.go, line 31:
unexpected error "Bad request with: [POST http://128.141.193.156:9511/v1/clustertemplates], error message:
{\"errors\": [{\"status\": 400, \"code\": \"client\", \"links\": [],
               \"title\": \"docker volume size None GB is not valid, expecting minimum value 3GB for devicemapper storage driver\",
               \"detail\": \"docker volume size None GB is not valid, expecting minimum value 3GB for devicemapper storage driver.\",
               \"request_id\": \"\"}]}"

I don't know if this is specific to my devstack or not. @jtopjian do the containerinfra acceptance tests not run in the openlab testing? I don't see them in the logs/results.

@tghartland
Copy link
Copy Markdown
Contributor Author

No this is the same on our production stein deployment.

$ openstack coe cluster template create test --coe kubernetes --image 2886e9bf-7702-4c06-99c1-39a9e7bd5951 --external-network CERN_NETWORK
docker volume size None GB is not valid, expecting minimum value 3GB for devicemapper storage driver (HTTP 400)

It's only a problem when using the devicemapper storage driver, setting docker_storage_driver to overlayfs allows the volume size to be unset.

I think this needs a separate fix to the acceptance test to set the volume size, as long as it doesn't break anything else in the testing environment.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Nov 20, 2019

Build failed.

@tghartland
Copy link
Copy Markdown
Contributor Author

The issue with the storagedriver was part of a larger problem, that moving on to the Create acceptance tests helped me figure out.

To begin with, the docker swarm template that is created here is not compatible for using node groups with (the full functionality of node groups requires a kubernetes cluster).

Since the node group tests will have to create their own template using kubernetes anyway, that template can use overlay2 as the storage driver which fixes that issue. There was also a problem with the template dns_nameserver which was preventing nodes from starting in our environment. I'm running with it pointing to our internal DNS for now and I'll leave it as 8.8.8.8 when I push the code here.

Next was an issue with timeouts. The acceptance tests for containerinfra/v1/clusters do not check this error here

clusterID, err := CreateCluster(t, client, clusterTemplate.UUID)

but since I had added an assert for this error in the node group tests I was seeing a time out from the WaitFor function that it uses after creating the cluster, which has a hard-coded timeout of 300 seconds
func WaitFor(predicate func() (bool, error)) error {
for i := 0; i < 300; i++ {
time.Sleep(1 * time.Second)

(this means that the containerinfra/v1/clusters tests start running on a cluster that is still in CREATE_IN_PROGRESS if the 300 second timeout is reached).

Cluster creation of a kubernetes cluster takes ~500 seconds in my devstack, so I have also had to duplicate the cluster creation function. In this I will manually loop and check the status instead of using tools.WaitFor so that I can extend the timeout.

I'll move the cluster and cluster template changes back from my Create branch to this one once I've made sure that everything is working properly.

@jtopjian
Copy link
Copy Markdown
Contributor

@tghartland Thank you for all of the work investigating these issues. Please feel free to update anything you see as needing fixed.

@tghartland
Copy link
Copy Markdown
Contributor Author

Acceptance test updated to use its own createTemplate and createCluster functions.

        nodegroups_test.go:126: Attempting to create cluster: TESTACC-94gWjZoc using template dd01f685-3d9d-45d8-b439-8ad73fad9ac9
        nodegroups_test.go:151: Cluster Create Request ID: req-5ca32995-eccf-4a6b-b8c8-e39d685d0a7e
        nodegroups_test.go:159: Cluster created: 9dc1e2a5-d826-4a95-9364-bbf02a6e552b
        nodegroups_test.go:179: Successfully created cluster: TESTACC-94gWjZoc id: 9dc1e2a5-d826-4a95-9364-bbf02a6e552b
    --- PASS: TestNodeGroupsCRUD/list (0.15s)
    --- PASS: TestNodeGroupsCRUD/listone-get (0.30s)
        containerinfra.go:137: Attempting to delete cluster: 9dc1e2a5-d826-4a95-9364-bbf02a6e552b
        containerinfra.go:155: Successfully deleted cluster: 9dc1e2a5-d826-4a95-9364-bbf02a6e552b
        containerinfra.go:76: Attempting to delete cluster-template: dd01f685-3d9d-45d8-b439-8ad73fad9ac9
        containerinfra.go:83: Successfully deleted cluster-template: dd01f685-3d9d-45d8-b439-8ad73fad9ac9
PASS
ok      github.com/gophercloud/gophercloud/acceptance/openstack/containerinfra/v1       561.073s

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Nov 22, 2019

Build succeeded.

@tghartland
Copy link
Copy Markdown
Contributor Author

@jtopjian I've finished the acceptance tests for create/update/delete and there's nothing else that would need to be propagated back to here, so it's ready for review.

@jtopjian
Copy link
Copy Markdown
Contributor

@tghartland Thanks! I'm going to see about getting Magnum/ContainerInfra re-enabled in OpenLab so we can have these tested regularly.

I might need you to rebase this if I'm able to get that working.

@tghartland
Copy link
Copy Markdown
Contributor Author

@jtopjian I can rebase whenever you're ready.

Is there a timeout for the tests in OpenLab? For my testing I had to add -timeout=20m to the script provided here. The full test with creating a cluster plus creating another node group took 15 minutes in devstack.

@jtopjian
Copy link
Copy Markdown
Contributor

I know OpenLab has a 3 hour global time limit set. I'll look at increasing the individual test timeout for the Magnum tests - thanks for the heads up.

And just to confirm: did you have to make any changes to the devstack environment or are the tests able to run in a "vanilla" environment?

@tghartland
Copy link
Copy Markdown
Contributor Author

There aren't any major changes, the only thing that might be an issue is that the devstack I'm using is a little out of date

commit 7840b6e291b5e28ba96ce871b5e01d66c14d9201 (HEAD -> master, origin/master, origin/HEAD)
Merge: 56f23cc5 c67a689f
Author: Zuul <zuul@review.opendev.org>
Date:   Tue Oct 8 19:33:53 2019 +0000

It also has this fix which isn't merged yet but the List tests don't use any paginated responses so that shouldn't be a problem.

Copy link
Copy Markdown
Contributor

@jtopjian jtopjian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tghartland I apologize for the delay. It looks like OpenLab needs to amend their jobs to have Magnum run in the tests, so I've opened an issue for this. As for testing locally, I'm a little pressed for time and haven't been able to verify it on my own, but I'll assume it works and we/I can sort out any issues once it's enabled in OpenLab later.

Overall this looks good. The comments I've left are just minor items. Please let me know if you have any questions.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Dec 11, 2019

Build failed.

@tghartland
Copy link
Copy Markdown
Contributor Author

@jtopjian thanks for your review. I've just pushed the suggested changes along with a rebase onto master for the changes in #1794.

Copy link
Copy Markdown
Contributor

@jtopjian jtopjian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thank you!

@jtopjian jtopjian merged commit 8d733f5 into gophercloud:master Dec 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants