Commit Graph

92 Commits (f416aa695544fafe09a7be02f34cebc0f4d718b4)

Author SHA1 Message Date
Hongbin Lu d28a780d77 Implement update bay node_count
It is implemented by updating the Heat stack with the new node_count

Partially implements: blueprint update-node-count

Change-Id: I2c331043bb6e6fce14fc82932dcd9c3677448598
8 years ago
Hongbin Lu d35c05bc3c Move bay defintion extraction code
This allows more code to be reused later.

Partially implements: blueprint update-node-count
Change-Id: I8619f110998673b6ba78d468d303eba361b7156a
8 years ago
Hongbin Lu ada97c347a Move variable attempts_count to local scope
This variable is concurrently read and write, so it needs to be local.
In addition, it needs to be incremented on each 'poll_and_check'.

Change-Id: I02ab50c7c005e11df9b9b84b0241323e24b9c295
Closes-Bug: 1419586
8 years ago
Davanum Srinivas 6a84010253 Change ctxt to context to for consistency
rename ctxt in all files under magnum/

Closes-Bug: #1416922
Change-Id: I28870d1381bd7107d431d5d3c76ad636f6d1d90a
8 years ago
Jenkins 1734d51714 Merge "Refactor bay_create at k8s conductor" 8 years ago
Hongbin Lu b72b8d61f5 Refactor bay_create at k8s conductor
Moved poll_and_checkout out of method bay_create. This allows code
to be reused by other methods in the class.

Partially implements: blueprint update-node-count
Change-Id: I6b9073fa9f8e6cfb8f28ce0d6d6b8997ad1d4309
8 years ago
Davanum Srinivas 17c5711c55 Remove imports from oslo namespaces
Oslo team is recommending everyone to use the direct imports and
not use the Oslo namespaces. So switch all our code to use oslo_*
instead of "from oslo." or "import oslo" or "from oslo"

NOTE: some of the tests still have mocks referring to oslo.utils
@mock.patch('oslo.utils.timeutils.utcnow')
as the tests break otherwise. We should do this later.

Closes-bug: #1419385
Change-Id: I8e3fbeb833cddc3f55674a0e781ffe69d5033ad4
8 years ago
Davanum Srinivas d43259dbf2 Cleanup code and remove newly ignored hack rules
newer hacking has rules for the following:
  H105  Don't use author tags
  H238  old style class declaration, use new style (inherit from `object`)
  W292 no newline at end of file

So we need to clean them up and stop ignoring them

Change-Id: I12b995cf87d6bc0938298f397b41a4693627bb4b
8 years ago
Jay Lau (Guangya Liu) d0785caf3c Correct typo for function name
Change 'retrive' to 'retrieve' for some function name

Change-Id: Ia6a16615641d81c63a8d64cd8a7f0e3fe35e8d82
8 years ago
Jay Lau (Guangya Liu) d2dede5723 Make sure no duplicate stack name when creating k8s bay
Change-Id: I2ef6ef9f8cdd317d574312ac591f5e65bf227d2e
Closes-Bug: #1412497
8 years ago
Jenkins dcee24ad9c Merge "Remove automatic deletion of failed stacks" 8 years ago
Jenkins 91bd286129 Merge "Delete bay independent of presence of heat stack" 8 years ago
Steven Dake fd7cde87c9 Allow deletion of rc/service/pod if stack has been deleted
If the Heat stack has already been deleted by a different context,
then there is no reason to check the results of the rc/pod/service
deletion.  They will always fail, resulting in an undeleteable object.

Worse, the bay becomes undeletable.

Change-Id: Ie98b9effaa15e8849aa66d8476838c293af80150
Closes-bug: #1412204
8 years ago
Steven Dake cc085b4cf4 Delete bay independent of presence of heat stack
If the Heat stack has already been deleted by the user, it shouldn't
block the bay from being deleted.  Instead just ignore that  Heat
exception and continue on deleting the bay as if the Heat stack
had already been deleted (because it has, or Heat has suffered data loss)

Change-Id: I38da49044f155105502a7e1bcccff45cde29fa86
Closes-Bug: 1412204
8 years ago
Steven Dake f579bc8235 Remove automatic deletion of failed stacks
Prior to this patch, Magnum would delete stacks that entered the
FAILED state.  This resulted in the information about why the
orchestration failed being lost to the user, and only avaialble
in the system logs.

Instead, keep the stack around so it can be inspected and delete
it when the bay is deleted.

Change-Id: Ie61b84ee00ea4f96580f5725e72ca35b855e0417
Closes-Bug: 1412213
8 years ago
Jenkins a7790b4327 Merge "Rename `resource`_data/url attributes to manifest/manifest_url" 8 years ago
OTSUKA, Yuanying cf41146263 Fix _retrive_k8s_master_url
If baymodel.apiserver_port is None, _retrive_k8s_master_url method return
invalid k8s master address. This fixes it.

Change-Id: Ieb907fbdb8a81b6b7a69f4d13549a24c3b58e6f8
Closes-Bug: #1411518
8 years ago
OTSUKA, Yuanying a61f1ff719 Rename `resource`_data/url attributes to manifest/manifest_url
Pod, Service and ReplicationController have data and definition_url attribute,
but it's name is needlessly long.
This fixes it to more appropriate attribute name.

Change-Id: I64e8922ef8f6fc0dc4a7fda02aa0913ca15177e4
8 years ago
Jay Lau (Guangya Liu) 7c00de388f Make replication controller delete working
Change-Id: I00aedeaeac5f7f72f2f9b530a116e772890b50fa
8 years ago
Jenkins 2a3b73b9d7 Merge "Implement bay deletion on api" 8 years ago
OTSUKA, Yuanying f8ae58f2a2 Implement bay deletion on api
Heat stack was not deleted when bay deleted. This fixes it.

Change-Id: I52e82c3b50854f80c86b6553e99d256962a38497
Closes-bug: #1410507
8 years ago
Jay Lau (Guangya Liu) 9c68323035 Add rc_data support for magnum replication controller
Change-Id: I041ee8a4e111d6c900ff6d654eeb23d61fff28ff
8 years ago
OTSUKA, Yuanying 444a202859 Implement service deletion
Service deletion is working from magnum api.

Change-Id: Ifbd10246682dda32bb28bbc1d640ff365d53495d
8 years ago
Jenkins 978b28e4ea Merge "Implement pod deletion" 8 years ago
Jay Lau (Guangya Liu) 1c5361304d Enable kube.py get k8s api server port from baymodel
Implements part of bp override-native-rest-port

Change-Id: I8a061d97757d5284c277675c46c416a88b64d895
8 years ago
OTSUKA, Yuanying b30b4f1f25 Implement pod deletion
Pod deletion is working from magnum api.

Change-Id: I6b6ccc9d95bddc42a98450cebac15bfd7aceab37
8 years ago
OTSUKA, Yuanying cdd963fd2d Parse stack output value for bay
To retrieve a k8s address correctly, this parses stack output values.
Sequence of outputs seems have no particular order.

Change-Id: I2ab74528a0914d4bd63ce65a5c62211ccc6d723a
8 years ago
OTSUKA, Yuanying 596233a2b4 Remove apiserver_port attribute from bay_definition
In this time, our heat-template doesn't support apiserver_port parameter.
So this parameter causes failing to create a stack.
This patch removes this parameter to use.

Change-Id: I8edd23a9464fed45c87f14aaa0d3609ad7f07fc2
8 years ago
Jay Lau (Guangya Liu) a7f505810f Update the sequence for master_address and minion_addresses
In the output of kubecluster.yaml, master_address is the 0th value
and minion_addresses is the 2nd value

Change-Id: I5c0c481c37ad3f2b23dfe0f1c6c70ce74c3290f1
8 years ago
Jay Lau (Guangya Liu) 557a1457ed Add apiserver_port to BayModel
Implements part of bp override-native-rest-port

Change-Id: I335d12a111ec433b6c312b119a6b4466c5480f15
9 years ago
Jenkins d8df3b3a4c Merge "Implement service creation" 9 years ago
Jenkins 5300e990be Merge "Implement pod creation" 9 years ago
OTSUKA, Yuanying bdabe2e592 Implement service creation
Service creation is working from magnum api now.

Change-Id: I97fbe4e47c444969ff77adb600b4fd7203eeb194
9 years ago
OTSUKA, Yuanying 5d79a518bc Implement pod creation
Pod creation is working from magnum api now.

Change-Id: I4d8359302306d3bfafaf2c57ba9706d8a3f21629
9 years ago
Jenkins dd9779b8a0 Merge "Docker: Pull Image Before Container Create" 9 years ago
Andrew Melton 46ebff53e6 Docker: Pull Image Before Container Create
The image needs to be pulled so that it's available for
subsequent inspect and create calls.

Change-Id: I7f2731911a3fc71fbbf3b408b39e57b7521db81f
Closes-bug: #1408101
9 years ago
Jenkins 34abc87d6a Merge "Add some comments for delete logic in bay_create" 9 years ago
OTSUKA, Yuanying 9ff6b93e08 Implements k8s resource creation/updating with data
Now kube_utils.py supports creation/updating from k8s resource data.
User will be able to updload pod/service/replication_controller data to
create or update resource.

Change-Id: I98f7ab2eab7ac9e68c4e4a313a61f7d39b7596b2
9 years ago
Jay Lau (Guangya Liu) bd8b58614b Add some comments for delete logic in bay_create
This patch is adding some comments for why adding delete logic
in bay_create for bay_k8s_heat.py

Closes-Bug: #1407832

Change-Id: I7cb103e5370f1c367b20272918314231e65f35e7
9 years ago
OTSUKA, Yuanying be136bbd8e Add master endpoint support to kube_utils.py
kubeutils.py support k8s master endpoint url to connect remote k8s cluster.
In this change, some method signatures are refactored for future works.

Change-Id: Ie065abeef3c65ea429b799a932fe39d868fabcbf
9 years ago
Jay Lau (Guangya Liu) 068874d0db Add unit tests for the conductor AMQP API
This tests create and delete at the AMQP level and makes certain the AMQP
code is being called.  This does not actually test the connection to the
handlers, which would be more like a functional test.

This test case purpose is meant to introduce pain when changing the
interface.  The interface should not be changed, a new version should
be implemented.

Change-Id: Icfca04df842497515c20138ba58694805b266b55
9 years ago
OTSUKA, Yuanying ded30d1237 Add test and refactoring on bay_create
This contains temporary implementation of updating master_address, refactoring
rpc handler and some tests.

Change-Id: Idc88795908441d987d9bb63292daccae523f7cbf
9 years ago
Jay Lau (Guangya Liu) a4f184c844 Remove ctxt from RPC API
The ctxt was provided by default RPC so there is no need to add
it for RPC API

Change-Id: I199ebc6e981ad0ae73cceb3166079d690fd64554
9 years ago
Steven Dake 5d20742212 Remove ctxt from rpcapi for pod create
the rpcapi does not need ctxt for pod create.  This results in an error
creating the POD complaining about incorrect number of parameters.

Change-Id: I98adb0c68fbcc527cd012ff353e4fd831297658b
9 years ago
Steven Dake 7cb3897ac5 bay-create does not need ctxt on the rpcapi side
The rpcapi client does not need ctxt.  the rpcapi delivery will generate
a context automatically via the RPC subsystem.

Change-Id: Iac1e8937a24db193db94cf20307fdabba408037f
9 years ago
Jay Lau (Guangya Liu) 493eeb8af2 Make bay, service and pod show call db directly
Change-Id: I49d87ab0cb32cd76e79a986f9f4cd340decc91f7
9 years ago
Jay Lau (Guangya Liu) 5a72df3662 Make baymodel operations working
Change-Id: I3d971e52b4032538cbfa089dd5b5a9ad88d4088c
9 years ago
Jay Lau (Guangya Liu) 6acf2e7a0f Add ctxt for all conductor APIs
Change-Id: I7bc27b5716aec85e50a3c7824667c3f762557fa0
9 years ago
Jay Lau (Guangya Liu) b37036c34d Add k8s replication support for magnum
Implements bp add-k8s-replication-controller

Change-Id: I5aee1af171b0a3a1476fd9fee1fdf26755ab0805
9 years ago
Jenkins d46ac431e5 Merge "Move out docker client logic from docker conductor" 9 years ago