Commit Graph

67 Commits (f416aa695544fafe09a7be02f34cebc0f4d718b4)

Author SHA1 Message Date
Jenkins f9db2b547b Merge "Add status attribute to bay" 8 years ago
OTSUKA, Yuanying 57249650cc Add status attribute to bay
When a Bay is created, we use Heat to bring up resources to use for the Bay.
We would like to see the related status in the Bay resource that tracks what's
happening. We use the new status attribute to show what is happening with Heat
behind the scenes.

Partially-Implements: blueprint magnum-bay-status

Change-Id: I7b841f2afbe575b039ebbde0e19d8fc464246608
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 bb29c1a0df Merge "Remove imports from oslo namespaces" 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 d82366f826 Tech Debt: Fixed code alignment issues
Just code reformatting in the objects/ folder

Closes-Bug: 1416789
Change-Id: I4dfd4412d032a2a67a370abfe673302b0820058d
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) 63040c95d8 Remove API get() for some magnum objects
The get() API was not used by the following objects, just remove it.

1) node
2) pod
3) replication controller
4) service
5) container

Change-Id: I2f578f8d072d772bf34e676b115eccf6c08bac8a
8 years ago
Jay Lau (Guangya Liu) ce0ef7c421 Enable multi tenant for k8s resource get_xx_by_id
1) get_pod_by_id
2) get_service_by_id
3) get_rc_by_id

Implements part of bp multi-tenant

Change-Id: I4b3bb49984b14369e7d79c7981271b17d6169646
8 years ago
Jay Lau (Guangya Liu) 150139321a Enable multi tenant for k8s resource get_xxx_list
1) get_pdod_list
2) get_service_list
3) get_rc_list

Implements part of bp multi-tenant

Change-Id: I40cefd7f4f637808afbcf172a5d98fddee066f2b
8 years ago
Jay Lau (Guangya Liu) de93db51b9 Enable multi tenant for two k8s resource operation APIs
1) get_service_by_uuid
2) get_rc_by_uuid

Implements part of bp multi-tenant

Change-Id: Ib96e777bf73c7e29e1dc0834df273e11d14bd8c7
8 years ago
Jay Lau (Guangya Liu) 1e98de6973 Enable multi tenant for get_pod_by_uuid
Implements part of bp multi-tenant

Change-Id: Ief0c3f93880f62a3bc50132927338c83447b7739
8 years ago
Jay Lau (Guangya Liu) 41f15002e3 Add project_id and user_id to service and rc
Implements part of bp multi-tenant

Change-Id: I0140e5233fc801b8353a65b8342a181a162f8cb4
8 years ago
Jay Lau (Guangya Liu) 2a4332b9ad Add project_id and user_id to pod
Implements part of bp multi-tenant

Change-Id: Ic7251e1fec612603e9126022e1c21986090b79ab
8 years ago
Jay Lau (Guangya Liu) c182dadb17 Enable multi tenant for get_xxx_by_id
The updated API include the following:
1) get_bay_by_id
2) get_baymodel_by_id
3) get_node_by_id
4) get_container_by_id

Implements part of bp multi-tenant

Change-Id: I7d2f8b7ea361b38d6f0110772c10f93037c7aefb
8 years ago
Jay Lau (Guangya Liu) 003d5a199b Enable multi tenant for get_xxx_list
The updated API include the following:
1) get_node_list
2) get_baymodel_list
3) get_bay_list
4) get_container_list

Implements part of bp multi-tenant

Change-Id: Iabc81288cf58d0a7da4f4fec90a1be561d41d9f3
8 years ago
Jay Lau (Guangya Liu) 2cb1682fa3 Enable multi tenant for get_xx_by_uuid
The updated API include the following:
1) get_bay_by_uuid
2) get_baymodel_by_uuid
3) get_node_by_uuid
4) get_container_by_uuid

Implements part of bp multi-tenant

Change-Id: I6cff457e585b4dd11f485eb63e477b8de0e96bea
8 years ago
Jay Lau (Guangya Liu) d321980cb4 Enable bay delete support multi tenant
Implementes part of bp multi-tenant

Change-Id: I4eb26adabc34f8f359539cbd41cc2cda070db878
8 years ago
Jay Lau (Guangya Liu) 57b9482487 Add project_id and user_id to magnum objects
project_id and user_id were added to the following tables:
1) container
2) node
3) bay
4) baymodel

Implements part of bp multi-tenant

Change-Id: Ied9a855251246bb087bc8bca70809a81594f26c7
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) e7a2366af6 Set replication controller name from rc manifest
Only replication controller manifest knows about rc name, so
this patch retrieve rc name from rc manifest.

Change-Id: I8193c2066ea1f0a40761f304f784fbb3b2d16796
8 years ago
Jay Lau (Guangya Liu) 9c68323035 Add rc_data support for magnum replication controller
Change-Id: I041ee8a4e111d6c900ff6d654eeb23d61fff28ff
9 years ago
OTSUKA, Yuanying b982600545 Set service name from service manifest
Only service manifest knows about service name, so this patch retrieve service
name from service manifest.

Change-Id: I1eb0f7dd7227875e1d10e5bd1d22f7e989e15f86
9 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
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
Jay Lau (Guangya Liu) 01ce1daac8 Add bay_uuid for replication controller
bay_uuid is needed when creating replication controller

Change-Id: If88235bda4b2f9833058533d1308fd89e6b6da4d
9 years ago
Hongbin Lu e54428845b Add tests for Pod and Service on dbapi
Did the following fix/modification to make the tests pass:
* Raise an exception on deleting non-existent pod or service.
* Rename the following methods:
  get_service_by_bay_uuid -> get_services_by_bay_uuid (db)
  get_by_bay_uuid -> list_by_bay_uuid (objects)

Change-Id: I7cbeb119550acecdbf0697df19172a8285eabca8
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 5e4483f2d3 Merge "Service create need filename as parameter" 9 years ago
Jay Lau (Guangya Liu) 8ac4dc813f Service create need filename as parameter
This is the backend change for patch Iaae8486

The k8s service create only has one parameter as filename, this
patch is updating magnum backend api can use filename as parameter
when creating service.

Change-Id: I67f0cea72b00f1ce35bf3e8c49153daf1d2fff68
9 years ago
OTSUKA, Yuanying 6ad1fb26a4 Implement creating Bay using heat
Co-authored-by: Steven Dake <sdake@redhat.com>
Implements-blueprint: backend-bay-heat-kube

Change-Id: Ia544d8bd3bc03afa900247b8da09675c0c6aec71
9 years ago
Jay Lau (Guangya Liu) 426009cf03 Pod create need filename as parameter
This is the backend change for patch I254a20a

The k8s pod create only has one parameter as filename, this patch
is updating magnum backend api can use filename as parameter when
creating pod.

Change-Id: Ibdc05415ce2cb4e30f1d5687b03f2c0761047dec
9 years ago
Jenkins b99628af3b Merge "Add more fields for service" 9 years ago
Jay Lau (Guangya Liu) 453952d102 Add more fields for service
Change-Id: I37ff2b98cd97bdebf599d5345a45e52bdd80b696
9 years ago
Jay Lau (Guangya Liu) 9790b2301f Add more fields for Pod
Maingly adding images, labels, status to pod object

Change-Id: I1c16e97b8e4182644fa0da93f256e23e4f79deb3
9 years ago
OTSUKA, Yuanying c80a80fe2b Remove objects.registry.py
objects class can be obtained from its module, so now objects doesn't
need registry.

Change-Id: Ia982a345c7b231b753a71f8f6a030490fec0d5a2
9 years ago
Jenkins 6d2a54796f Merge "Add a new API of get_by_pod_name for pod object" 9 years ago
Jenkins 1339ad4760 Merge "Remove redundant version info for magnum objects" 9 years ago
Davanum Srinivas df4e64186e Flesh out some more docker container methods
First cut of Docker container creation and start should be working now

Tested using the REST API:
curl -i -X POST -H 'X-Auth-Token: 1b238d90cd0645a39a626581cf0c9f19' \
     -H 'Content-Type: application/json' \
	 -H 'Accept: application/json' \
	 -d '{"image_id": "cirros", "name": "mycontainer"}' \
	 http://127.0.0.1:9511/v1/v1/containers

curl -i -X PUT -H 'X-Auth-Token: 1b238d90cd0645a39a626581cf0c9f19' \
     -H 'Content-Type: application/json' \
	 -H 'Accept: application/json' \
	 -H 'User-Agent: python-magnumclient' \
	 http://127.0.0.1:9511/v1/containers/4e19a981-057f-4d55-9aaf-d12c06e6430a/start

And the magnum CLI:
echo '{"name":"mycontainer", "image_id":"cirros"}' | magnum --debug container-create
magnum --debug container-start --id c6d6c759-9875-4dd4-aaa3-619799015c1d

Change-Id: Ib7a46d95d2d89cd8479bb0a318a3c9efaf23f187
9 years ago
Jay Lau f872b84708 Remove redundant version info for magnum objects
Change-Id: I2956636c87d30374d60800cc56ca26ba2524604a
9 years ago
Jay Lau 0343637f5f Add a new API of get_by_pod_name for pod object
In k8s, pod name cannot be duplicated and some end users want to
get pod by name.

Change-Id: Ic8b6273de914949e4799446e68e5e2d51bfab8b9
9 years ago
Steven Dake 54e59ea12e Remove type and image_id replace with baymodel_id
The baymodel_id represents the bay model used to generate this
particular Bay.  This is essentially a split of Bay into multiple
objects - one for template storage - one for instantation.

Change-Id: Ie6b7220bfecfd61af0ecf9114a791dfed61b415e
9 years ago
Steven Dake 3f520bbde5 Add a baymodel object
The baymodel object and ReST object is used to control bay properties
for different bay models.  It is then possible to launch bay models
using this functionality.

Change-Id: I317bda292719ca3f4649283f7e27674c813cc3b0
9 years ago
Abhishek Chanda 92e3ebee20 Migrate to oslo.context
Remove deprecated oslo incubator code

Change-Id: Iee16111fc86aef83603251aedf6d58f6da78fc92
9 years ago
Pradeep Kilambi 598b9aae99 Implement Service object Rest APIs
Partially Implements: blueprint magnum-backend-kubernetes

Change-Id: I27bb1d4ec2174abb30e7770daaeab24c26987d01
9 years ago
Pradeep Kilambi 71458fb8ea Add bay uuid to Service Objects
Change-Id: Ia8b757d5bbe477c2de09b65f35409847fd1623c3
9 years ago
Steven Dake 39a1ed9f5a Add a node object
The node object represents either a bare metal or virtual machine node
that is provisioned with an OS to run the containers, or alternatively,
run kubernetes.

Change-Id: I9eba14232c193688347b7ec2674c83f230404ae1
9 years ago
Jenkins 79d61e5244 Merge "Add image_id and node_count to bay" 9 years ago
Steven Dake fc7c1aa395 Add image_id and node_count to bay
The idea of bay-create is that you create a grouping of machines that run
container software.  In order to do this, an image_id stored in glance is
necessary to pull the base image to modify for launching by either heat or
Ironic.  A node_count is needed as well, to identify how many ironic nodes
you want to launch.

Change-Id: I5689d024f4ece93369498bd7f64cde0b8a59e292
9 years ago