Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Add new nodejs-postgres stack #1086

Merged
merged 8 commits into from
Dec 11, 2018

Conversation

jarifibrahim
Copy link
Contributor

What does this PR do?

In order to run multi-container booster in che (https://github.com/nodeshift-starters/nodejs-rest-http-crud) we need to add a new stack which has 2 machines, first one is the dev machine with node and the second machine has the postgres database.

What issues does this PR fix or reference?

N/A

How have you tested this PR?

Yes. I have tested this stack locally and it works as expected.

In order to run multi-container booster in che (https://github.com/nodeshift-starters/nodejs-rest-http-crud) we need to add a new stack which has 2 machines, first one is the dev machine with node and the second machine has the postgres database.

Signed-off-by: Ibrahim Jarif <[email protected]>
@centos-ci
Copy link
Collaborator

@jarifibrahim The che server [build 814] has been successfully deployed.

http://rhche-prcheck-1086.devtools-dev.ext.devshift.net

@jarifibrahim
Copy link
Contributor Author

The nodejs stack is failing with

Loading...
pulling image "eclipse/node"
Successfully pulled image "eclipse/node"
Created container
Started container
pulling image "registry.centos.org/postgresql/postgresql:9.6"
Successfully pulled image "registry.centos.org/postgresql/postgresql:9.6"
Error: Error response from daemon: create bf02f38276729574b6586e049129587cdeb36a951e4d1d38129ec8b8bb8a955d: error while creating volume path '/var/lib/docker/volumes/bf02f38276729574b6586e049129587cdeb36a951e4d1d38129ec8b8bb8a955d/_data': mkdir /var/lib/docker/volumes/bf02f38276729574b6586e049129587cdeb36a951e4d1d38129ec8b8bb8a955d: permission denied

How can I fix these permissions?

@sbose78
Copy link
Member

sbose78 commented Nov 21, 2018

@jarifibrahim could you switch to quay.io/openshiftio/che-centos-nodejs ?

@jarifibrahim
Copy link
Contributor Author

@jarifibrahim could you switch to quay.io/openshiftio/che-centos-nodejs ?

Done. See ba45c6f

@centos-ci
Copy link
Collaborator

@jarifibrahim The che server [build 815] has been successfully deployed.

http://rhche-prcheck-1086.devtools-dev.ext.devshift.net

@ibuziuk ibuziuk self-requested a review November 21, 2018 16:00
@centos-ci
Copy link
Collaborator

@jarifibrahim The che server [build 816] failed.

Link URL
console https://ci.centos.org/view/Devtools/job/devtools-rh-che-rh-che-prcheck-dev.rdu2c.fabric8.io/816/console
artifacts http://artifacts.ci.centos.org/devtools/che-functional-tests/devtools-rh-che-rh-che-prcheck-dev.rdu2c.fabric8.io/816/

If the build or deployment fails, the artifacts will not be present. Don't panic, just grab a towel.

@ibuziuk
Copy link
Member

ibuziuk commented Nov 21, 2018

[test]

@jarifibrahim
Copy link
Contributor Author

@ibuziuk I've changed the docker image for the Postgres and that's why the build is failing.

@centos-ci
Copy link
Collaborator

@jarifibrahim The che server [build 817] failed.

Link URL
console https://ci.centos.org/view/Devtools/job/devtools-rh-che-rh-che-prcheck-dev.rdu2c.fabric8.io/817/console
artifacts http://artifacts.ci.centos.org/devtools/che-functional-tests/devtools-rh-che-rh-che-prcheck-dev.rdu2c.fabric8.io/817/

If the build or deployment fails, the artifacts will not be present. Don't panic, just grab a towel.

@ibuziuk
Copy link
Member

ibuziuk commented Nov 21, 2018

[test]

@ibuziuk
Copy link
Member

ibuziuk commented Nov 21, 2018

@jarifibrahim I do not think it is related

@centos-ci
Copy link
Collaborator

@jarifibrahim The che server [build 818] has been successfully deployed.

http://rhche-prcheck-1086.devtools-dev.ext.devshift.net

@jarifibrahim
Copy link
Contributor Author

I see the same error even after changing the Postgres docker image.

@jarifibrahim
Copy link
Contributor Author

The same stack runs fine on Che running via minishift locally.

@ibuziuk
Copy link
Member

ibuziuk commented Nov 21, 2018

@jarifibrahim could you please point to the dockerfile of the postgres image used in the stack ?

@jarifibrahim
Copy link
Contributor Author

@jarifibrahim could you please point to the dockerfile of the postgres image used in the stack ?

For image: lib/postgres - https://github.com/docker-library/postgres/tree/master/9.6
and for centos/postgresql-96-centos7/ - https://github.com/sclorg/postgresql-container/tree/generated/9.6

@jarifibrahim
Copy link
Contributor Author

jarifibrahim commented Nov 27, 2018

@sbose78 @ibuziuk Looks like volume mount doesn't work for mysql container as well https://github.com/sclorg/mysql-container/blob/master/5.7/Dockerfile#L73 because of sclorg/httpd-container#30.

What else can we do to get Postgres container running?

EDIT -
The above mentioned issue was related to S2I builds. We aren't dealing with S2I builds for now so it has nothing to do with this stack/PR.

@sbose78
Copy link
Member

sbose78 commented Nov 27, 2018

Does this image work registry.centos.org/postgresql/postgresql:9.6 ?
I had used it in a recipe, from which I had created a workspace on che.openshift.io https://gist.github.com/sbose78/5c4ad4e3fd2fea7efb4efb3849ecdea4#file-gistfile1-txt-L24

EDIT:
(^^ ignore, you had changed it. :) )

@jarifibrahim
Copy link
Contributor Author

According to openshift/origin#16211 (comment) we need to mount the volume on the specific path. @ibuziuk Is there a way to do this? I tried adding a volume via UI and updating the recipe but it doesn't seem to work.

@jarifibrahim
Copy link
Contributor Author

I've raised sclorg/postgresql-container#301 to remove volume from the centos-postgresql image.

@centos-ci
Copy link
Collaborator

@jarifibrahim The che server [build 851] has been successfully deployed.

http://rhche-prcheck-1086.devtools-dev.ext.devshift.net

@jarifibrahim
Copy link
Contributor Author

I managed to fix the volume issue using the correct PV claim dc8659f .
The stack works out of the box with https://github.com/nodeshift-starters/nodejs-rest-http-crud now 🎉

@centos-ci
Copy link
Collaborator

@jarifibrahim The che server [build 878] has been successfully deployed.

http://rhche-prcheck-1086.devtools-dev.ext.devshift.net

amisevsk
amisevsk previously approved these changes Dec 7, 2018
Copy link
Collaborator

@amisevsk amisevsk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jarifibrahim! I've tested the stack and it mostly works great on che.openshift.io, there is just one small change that needs to be made (see below).

On che.openshift.io, using this stack, I see volumemount claim-che-workspace, subpath workspaceakco96ccz55a4c6e/postgresdata → /var/lib/pgsql/data on the database container, which is perfect :)

amisevsk
amisevsk previously approved these changes Dec 7, 2018
@centos-ci
Copy link
Collaborator

@jarifibrahim The che server [build 885] has been successfully deployed.

http://rhche-prcheck-1086.devtools-dev.ext.devshift.net

@jarifibrahim
Copy link
Contributor Author

Thank you so much @amisevsk. That fix worked perfectly :)

@centos-ci
Copy link
Collaborator

@jarifibrahim The che server [build 886] failed.

Link URL
console https://ci.centos.org/view/Devtools/job/devtools-rh-che-rh-che-prcheck-dev.rdu2c.fabric8.io/886/console
artifacts http://artifacts.ci.centos.org/devtools/che-functional-tests/devtools-rh-che-rh-che-prcheck-dev.rdu2c.fabric8.io/886/

If the build or deployment fails, the artifacts will not be present. Don't panic, just grab a towel.

@centos-ci
Copy link
Collaborator

@jarifibrahim The che server [build 887] failed.

Link URL
console https://ci.centos.org/view/Devtools/job/devtools-rh-che-rh-che-prcheck-dev.rdu2c.fabric8.io/887/console
artifacts http://artifacts.ci.centos.org/devtools/che-functional-tests/devtools-rh-che-rh-che-prcheck-dev.rdu2c.fabric8.io/887/

If the build or deployment fails, the artifacts will not be present. Don't panic, just grab a towel.

"protocol": "http"
}
},
"volumes": {},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ibuziuk @amisevsk Do we need to mount a volume here for the user data? Like /projects ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, project is mounted by default. No need to explicitly specify if

@jarifibrahim
Copy link
Contributor Author

[test]

@centos-ci
Copy link
Collaborator

@jarifibrahim The che server [build 888] failed.

Link URL
console https://ci.centos.org/view/Devtools/job/devtools-rh-che-rh-che-prcheck-dev.rdu2c.fabric8.io/888/console
artifacts http://artifacts.ci.centos.org/devtools/che-functional-tests/devtools-rh-che-rh-che-prcheck-dev.rdu2c.fabric8.io/888/

If the build or deployment fails, the artifacts will not be present. Don't panic, just grab a towel.

@ibuziuk
Copy link
Member

ibuziuk commented Dec 10, 2018

[test]

@centos-ci
Copy link
Collaborator

@jarifibrahim The che server [build 890] failed.

Link URL
console https://ci.centos.org/view/Devtools/job/devtools-rh-che-rh-che-prcheck-dev.rdu2c.fabric8.io/890/console
artifacts http://artifacts.ci.centos.org/devtools/che-functional-tests/devtools-rh-che-rh-che-prcheck-dev.rdu2c.fabric8.io/890/

If the build or deployment fails, the artifacts will not be present. Don't panic, just grab a towel.

@ibuziuk
Copy link
Member

ibuziuk commented Dec 10, 2018

[test]

@centos-ci
Copy link
Collaborator

@jarifibrahim The che server [build 891] failed.

Link URL
console https://ci.centos.org/view/Devtools/job/devtools-rh-che-rh-che-prcheck-dev.rdu2c.fabric8.io/891/console
artifacts http://artifacts.ci.centos.org/devtools/che-functional-tests/devtools-rh-che-rh-che-prcheck-dev.rdu2c.fabric8.io/891/

If the build or deployment fails, the artifacts will not be present. Don't panic, just grab a towel.

@ibuziuk
Copy link
Member

ibuziuk commented Dec 10, 2018

@rhopp @ScrewTSW @Katka92 seems to be failing with:

OpenShift username and password and Keycloak token are not empty.
Tests are executed with user: rh-ch e-automation-preview
OSO_MASTER_URL found and set to: https://api.starter-us-east-2a.openshift.com
Active token has 1 sections.
JWT token parse failed!

Any ideas what is the reason ?

@Katka92
Copy link
Collaborator

Katka92 commented Dec 10, 2018

I think that the problem is in a way obtaining active token for test user. I'll have a look and try to fix it ASAP.

@ScrewTSW
Copy link
Member

@ibuziuk Fix for the issue. I have deleted keycloak token from the vault as it's not being used anymore. Sorry for the issues caused
#1137

@ibuziuk
Copy link
Member

ibuziuk commented Dec 11, 2018

[test]

@centos-ci
Copy link
Collaborator

@jarifibrahim The che server [build 901] has been successfully deployed.

http://rhche-prcheck-1086.devtools-dev.ext.devshift.net

@ibuziuk ibuziuk merged commit 092f109 into redhat-developer:master Dec 11, 2018
@jarifibrahim jarifibrahim deleted the node-crud-stack branch December 11, 2018 13:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants