projectatomic / openshift2nulecule

Create Nulecule application from OpenShift project
GNU General Public License v2.0
6 stars 9 forks source link

buildConfig for some apps fails while pushing image #42

Open kadel opened 8 years ago

kadel commented 8 years ago

For mlbparks: Importing BuildConfig triggers build that fails on this error:

Copying all WAR and EAR artifacts from /home/jboss/source/target directory into /opt/eap/standalone/deployments for later deployment...
Copying all WAR and EAR artifacts from /home/jboss/source/deployments directory into /opt/eap/standalone/deployments for later deployment...
'/home/jboss/source/deployments/ROOT.war' -> '/opt/eap/standalone/deployments/ROOT.war'
I0321 17:07:25.288691       1 sti.go:259] No push secret provided
I0321 17:07:25.289032       1 sti.go:261] Pushing 172.30.50.40:5000/java-import/mlbparks:latest image ...
F0321 17:07:25.331696 1 builder.go:204] Error: build error: Failed to push image. Response from registry is: Post https://172.30.50.40:5000/v2/java-import/mlbparks/blobs/uploads/: no basic auth credentials
kadel commented 8 years ago

There is more problems with BuildConfigs.

o2n exports finished images (result of BuildConfig) with DeploymentConfigs. When such BuildConfig is imported (and it build is successful) new image from BC is not used, instead of this, image from imported DC is used. For example this happens for ruby hello world example (oc new-app centos/ruby-22-centos7~https://github.com/openshift/ruby-hello-world.git)

kadel commented 8 years ago

I see two options what to do here.

1) stop exporting images (pull/push to external registry) If we can figure out shy exactly some imported builds fails we can skip exporting images and really on buildconfigs only. Benefit of this is that it would make thinks much easier when we don't have to deal with openshifts internal docker registry.

2) Stop exporting BuildConfigs and really only on finished images. We have to still export images from openshift docker registry. With all the complications with requiring another external registry

Or we can do both. When user wants to export images we do not export BuildConfigs, if user don't want to export images we do export BuildConfigs.

Your thoughts @surajssd ?

kadel commented 8 years ago

I just done couple more test with ruby-hello-world, I exported it with --export-images=all

When deploying exported app the following happens:

At first this behavior might be confusing, but it is basically OK :-)

But I've still not be able to figure out why some applications BuildConfigs fails (like mlbaparks) with following error

F0321 17:07:25.331696 1 builder.go:204] Error: build error: Failed to push image. Response from registry is: Post https://172.30.50.40:5000/v2/java-import/mlbparks/blobs/uploads/: no basic auth credentials

and other BuildConfigs are ok - like ruby-hello-world

kadel commented 8 years ago

This seems to be timing issue. It fails when BuildConfig is created before ImageStream.

This is already reported in Origin https://github.com/openshift/origin/issues/4518

kadel commented 8 years ago

It could be fixed by deploying artifacts in right order. But AtomicApp is not currently deploying artifacts in same order as they appear in Nulecule file.

Related issue: https://github.com/projectatomic/atomicapp/issues/669

kadel commented 8 years ago

One workaround for this would be using List with artifacts in right order, but this is not possible due to this: https://github.com/projectatomic/atomicapp/issues/612

kadel commented 8 years ago

Until we can specify order in Nulecule, only workaround for this is to restart build manually. It is going to work, because ImageStream is already created when restarting build again.