gravitee-io / gravitee-openshift

Gravitee.io APIM - OpenShift templates
3 stars 8 forks source link

Plugin can not be deployed #2

Open brasseld opened 6 years ago

brasseld commented 6 years ago

Hi @Emmanuel35,

I had a try with your OS template.

It seems that it does not work properly on my env (minishift). When the gateway is starting, I have a lot of access denied error:

19:30:52.444 [gravitee] [] ERROR i.g.p.c.internal.PluginRegistryImpl - An unexpected error occurs while loading plugin archive /opt/graviteeio-gateway/plugins/gravitee-repository-ehcache-1.0.0.zip
--
  | java.nio.file.AccessDeniedException: /opt/graviteeio-gateway/plugins/.work
  | at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
  | at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
  | at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
  | at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384)
  | at java.nio.file.Files.createDirectory(Files.java:674)
  | at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781)
  | at java.nio.file.Files.createDirectories(Files.java:767)
  | at io.gravitee.plugin.core.utils.FileUtils.unzip(FileUtils.java:75)
  | at io.gravitee.plugin.core.internal.PluginRegistryImpl.loadPlugin(PluginRegistryImpl.java:190)
  | at io.gravitee.plugin.core.internal.PluginRegistryImpl.loadPlugins(PluginRegistryImpl.java:131)
  | at io.gravitee.plugin.core.internal.PluginRegistryImpl.loadPluginsFromRegistry(PluginRegistryImpl.java:118)
  | at io.gravitee.plugin.core.internal.PluginRegistryImpl.init(PluginRegistryImpl.java:101)
  | at io.gravitee.plugin.core.internal.PluginRegistryImpl.doStart(PluginRegistryImpl.java:81)
  | at io.gravitee.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:32)
  | at io.gravitee.common.node.AbstractNode.doStart(AbstractNode.java:53)
  | at io.gravitee.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:32)
  | at io.gravitee.gateway.standalone.Container.start(Container.java:108)
  | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  | at java.lang.reflect.Method.invoke(Method.java:498)
  | at io.gravitee.gateway.standalone.boostrap.Bootstrap.start(Bootstrap.java:162)
  | at io.gravitee.gateway.standalone.boostrap.Bootstrap.main(Bootstrap.java:171)

Do you know the cause of such error. Did you change something in your gravitee images ?

brasseld commented 6 years ago

Ok, I was able to make it works better by updating the Dockerfile and adding this part:

RUN groupadd -g 1000 gravitee && \
    adduser -u 1000 -g 1000 -d ${GRAVITEEIO_HOME} gravitee

USER 1000

This must be added for both the gateway and the mgmt-api

rbriois commented 5 years ago

Is it possible to merge this to master ?

Thanks

brasseld commented 5 years ago

Hi @rbriois

It is already part of our docker images.

See https://github.com/gravitee-io/gravitee-docker/commit/0f38bac0e37909b3e7b97a8cef712e1bf0260591

Do you have any other issue?

rbriois commented 5 years ago

I've updated your comment to remove customer name.

somehow yes.

I try to deploy gravitee to openshift using this repository.

So when i launch create_all.cmd, the command :

oc new-build ../ --name=management-api --context-dir=images/management-api/ --strategy=docker --build-arg=GRAVITEEIO_VERSION=%GRAVITEEIO_VERSION%

it creates a build on openshift but bind it to this git project, not to gravitee-io/gravitee-docker.

--> Found Docker image d0d8234 (13 days old) from Docker Hub for "graviteeio/java:8"

    * An image stream will be created as "java:8" that will track the source image
    * A Docker build using source code from https://github.com/gravitee-io/gravitee-openshift.git#master will be created
      * The resulting image will be pushed to image stream "management-api:latest"
      * Every time "java:8" changes a new build will be triggered

--> Creating resources with label build=management-api ...
    buildconfig "management-api" created
--> Success
    Build configuration "management-api" created and build triggered.
    Run 'oc logs -f bc/management-api' to stream the build progress.

So i don't have last update.

Maybe i'll try something different or make a PR.

brasseld commented 5 years ago

And did you set the correct version before running the script ?

(I recognize that the version must be settled to latest by default....)

rbriois commented 5 years ago

I'll try some others tests !

for now, i'll just use latest image from docker hub

Edit : Yes, i set a correct version before running

brasseld commented 5 years ago

I had a try with Openshift some months ago. Can't tell you if something has been changed since this time...

But if you need help, I will be happy to re-install minishift and have a new try with latest versions of both OS and G.io

rbriois commented 5 years ago

Thanks ! Don't bother you for now ! i'll keep you inform