Skip to content
This repository has been archived by the owner on Jan 19, 2018. It is now read-only.

Order of OpenShift artifacts in Nulecule file #669

Open
kadel opened this issue Apr 4, 2016 · 7 comments
Open

Order of OpenShift artifacts in Nulecule file #669

kadel opened this issue Apr 4, 2016 · 7 comments

Comments

@kadel
Copy link
Collaborator

kadel commented Apr 4, 2016

If I remember correctly in previous version we deployed OpenShift artifacts in order which they appear in Nulecule file.
But this is not happening anymore :-(

Problem is that with OpenShift you sometimes need to create some objects before another.

in Nulecule:

    openshift:
    - file://artifacts/openshift/mlbparks-DeploymentConfig.json
    - file://artifacts/openshift/mongodb-DeploymentConfig.json
    - file://artifacts/openshift/mlbparks-BuildConfig.json
    - file://artifacts/openshift/mlbparks-ImageStream.json
    - file://artifacts/openshift/mlbparks-Service.json
    - file://artifacts/openshift/mongodb-Service.json

debug output:

1459790051 - [DEBUG] - providers/openshift.py - Processing artifact: artifacts/openshift/.mlbparks-DeploymentConfig.json
1459790051 - [DEBUG] - providers/openshift.py - Processing artifact: artifacts/openshift/.mongodb-DeploymentConfig.json
1459790051 - [DEBUG] - providers/openshift.py - Processing artifact: artifacts/openshift/.mlbparks-BuildConfig.json
1459790051 - [DEBUG] - providers/openshift.py - Processing artifact: artifacts/openshift/.mlbparks-ImageStream.json
1459790051 - [DEBUG] - providers/openshift.py - Processing artifact: artifacts/openshift/.mlbparks-Service.json
1459790051 - [DEBUG] - providers/openshift.py - Processing artifact: artifacts/openshift/.mongodb-Service.json
1459790051 - [DEBUG] - providers/openshift.py - Deploying to OpenShift
1459790051 - [DEBUG] - providers/openshift.py - url: https://127.0.0.1:8443/oapi/v1/namespaces/mlbimport/buildconfigs/?access_token=syqKpsfCXAT4nZaerLot3xrsZcCrKkRZEAti-RC1NLM
1459790051 - [INFO] - providers/openshift.py - Object mlbparks successfully deployed.
1459790051 - [DEBUG] - providers/openshift.py - url: https://127.0.0.1:8443/oapi/v1/namespaces/mlbimport/imagestreams/?access_token=syqKpsfCXAT4nZaerLot3xrsZcCrKkRZEAti-RC1NLM
1459790051 - [INFO] - providers/openshift.py - Object mlbparks successfully deployed.
1459790051 - [DEBUG] - providers/openshift.py - url: https://127.0.0.1:8443/api/v1/namespaces/mlbimport/services/?access_token=syqKpsfCXAT4nZaerLot3xrsZcCrKkRZEAti-RC1NLM
1459790051 - [INFO] - providers/openshift.py - Object mlbparks successfully deployed.
1459790051 - [DEBUG] - providers/openshift.py - url: https://127.0.0.1:8443/api/v1/namespaces/mlbimport/services/?access_token=syqKpsfCXAT4nZaerLot3xrsZcCrKkRZEAti-RC1NLM
1459790051 - [INFO] - providers/openshift.py - Object mongodb successfully deployed.
1459790051 - [DEBUG] - providers/openshift.py - url: https://127.0.0.1:8443/oapi/v1/namespaces/mlbimport/deploymentconfigs/?access_token=syqKpsfCXAT4nZaerLot3xrsZcCrKkRZEAti-RC1NLM
1459790051 - [INFO] - providers/openshift.py - Object mlbparks successfully deployed.
1459790051 - [DEBUG] - providers/openshift.py - url: https://127.0.0.1:8443/oapi/v1/namespaces/mlbimport/deploymentconfigs/?access_token=syqKpsfCXAT4nZaerLot3xrsZcCrKkRZEAti-RC1NLM
1459790051 - [INFO] - providers/openshift.py - Object mongodb successfully deployed.

Here it can bee seen that processing is happening in same order as in Nulecule file, but then deployment is in completely different one :-(

@kadel
Copy link
Collaborator Author

kadel commented Apr 4, 2016

Right now we don't have a way how to ensure order in which OpenShift artifacts are deployed. One workaround with this would be using List but that is not possible because right now our provider doesn't support it 😢 #612

@dustymabe
Copy link
Contributor

@kadel, given openshift object types, what is the requirement as far as ordering goes? I see you have a deploymentconfig buildconfig service and imagestream. What are the requirements for ordering there?

@surajssd
Copy link
Collaborator

surajssd commented Apr 5, 2016

When comparing service and replicationController, service must be created before rc. What are the other ideal chronological ordering?

@kadel
Copy link
Collaborator Author

kadel commented Apr 5, 2016

@dustymabe right now my concern is mainly about deploying imageStream before buildConfig because of this bug openshift/origin#4518
I think that deploying artifact in order they are specified in Nulecule might be enought to solve most of ordering issue with OpenShift.
Person who is creating Nulecule app then can decide what is right order of deployment for his application.

There another issue that touches ordering issue #18 this case is about creating services first before deploymentConfigs, replicationControllers and pods.

@surajssd
Copy link
Collaborator

surajssd commented Apr 6, 2016

@kadel @dustymabe we should come up with a rule or chronological order that specifies the order of deployment, for different providers (atleast for Kubernetes and OpenShift).
On the kubernetes documentation, "Best Practices for Configuration" describes in "Services" section that "It’s typically best to create a service before corresponding replication controllers, so that the scheduler can spread the pods comprising the service."

surajssd added a commit to surajssd/atomicapp that referenced this issue Apr 11, 2016
Openshift deployement is done via API, so the artifacts are read
locally and stored in a dict, which was causing the order of
artifacts to change while deployment, using OrderedDict paves
a way to keeping that sequence.

Fixes issue projectatomic#669
surajssd added a commit to surajssd/atomicapp that referenced this issue Apr 12, 2016
Openshift deployement is done via API, so the artifacts are read
locally and stored in a dict, which was causing the order of
artifacts to change while deployment, using OrderedDict paves
a way to keeping that sequence.

Fixes issue projectatomic#669
@surajssd
Copy link
Collaborator

@kadel @dustymabe are we going ahead with the idea of let user decide the order of artifact or are we gonna embed that intelligence into Atomic App, depending on that this can be closed or I can move forward with implementing that.

@dustymabe
Copy link
Contributor

I think we definitely want to have logic within Atomic App to deploy things in the "right" order. The only reason to not do this would be if we clearly identify paths where deploying things in that order is wrong.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants