atomicapp icon indicating copy to clipboard operation
atomicapp copied to clipboard

Order of OpenShift artifacts in Nulecule file

Open kadel opened this issue 9 years ago • 7 comments

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 avatar Apr 04 '16 17:04 kadel

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 :cry: https://github.com/projectatomic/atomicapp/issues/612

kadel avatar Apr 04 '16 17:04 kadel

@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?

dustymabe avatar Apr 04 '16 21:04 dustymabe

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

surajssd avatar Apr 05 '16 06:04 surajssd

@dustymabe right now my concern is mainly about deploying imageStream before buildConfig because of this bug https://github.com/openshift/origin/issues/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 https://github.com/projectatomic/atomicapp/issues/18 this case is about creating services first before deploymentConfigs, replicationControllers and pods.

kadel avatar Apr 05 '16 07:04 kadel

@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 avatar Apr 06 '16 15:04 surajssd

@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.

surajssd avatar Apr 20 '16 13:04 surajssd

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.

dustymabe avatar Apr 20 '16 14:04 dustymabe