GMOD / docker-apollo

:whale: Apollo 2.X Docker Image
GNU General Public License v3.0
10 stars 12 forks source link

change root URL #37

Closed hodgett closed 5 years ago

hodgett commented 5 years ago

I have successfully installed the docker, have it working, and have my organism viewable. I have also made the docker instance accessible behind Apache using the ProxyPass and ProxyPassReverse parameters so that I can easily use HTTPS. The problem I have now is that there are a number of links that are hard coded to the root i.e. any of the admin functions, public organisms. Is there a way of setting a parameter in the docker image to change the default root?

nathandunn commented 5 years ago

@hodgett Its very possible (probably). There are a large number of environmental variables that you can pass into the docker image:

https://github.com/GMOD/docker-apollo/blob/master/apollo-config.groovy#L72

But, maybe you mean something else. Are you talking about web services, or the copied links?

A little more detail would be helpful.

hodgett commented 5 years ago

Nope. Nothing useful in that reference. I assume it's the web services, when I click on a link within the Admin tab. In my case it doesn't take me to /apollo/proxy but to /proxy. Just like a public organism takes me to /32 instead of /apollo/31

nathandunn commented 5 years ago

Would you mind uploading a screenshot?

On Feb 27, 2019, at 8:09 PM, hodgett notifications@github.com wrote:

Nope. Nothing useful in that reference. I assume it's the web services, when I click on a link within the Admin tab. In my case it doesn't take me to /apollo/proxy but to /proxy. Just like a public organism takes me to /32 instead of /apollo/31

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/GMOD/docker-apollo/issues/37#issuecomment-468130064, or mute the thread https://github.com/notifications/unsubscribe-auth/AAt2qhK4X92X2Ij0193OEUgWsoTXCnIzks5vR1aSgaJpZM4bV84q.

hodgett commented 5 years ago

From the attached capture1 is when I am selecting from public organisms (note the apollo image doesn't show either). capture2 is when I click on the link - you can see the root folder is not /apollo/ any more; capture1 capture2

nathandunn commented 5 years ago

I see . . . okay I'll take a look

nathandunn commented 5 years ago

None of the parameters are hard-coded to root, but they are hard-coded to what they perceive as their relative path of the context. Thus it looks like the proxy-pass doesn't use the same path.

I'm going to try and add a fix so you can specify:

docker -e APOLLO_PATH=apollo

Or something similar.

nathandunn commented 5 years ago

@hodgett Seems to be working.

I used

 docker run -it -v /opt/apollo/:/data -p 8888:8080 -e APOLLO_PATH=apollo  c205deec03e3

after building it locally and it worked.

I'm sure it will rebuild in about in hour if you want to try it off of quay.

nathandunn commented 5 years ago

screen shot 2019-02-28 at 12 22 12 pm

hodgett commented 5 years ago

Hmm, docker can't find c205deec03e3. Are you going to commit to latest?

nathandunn commented 5 years ago

Yeah, that was my local image as an example.

You'l want to use the latest quay build instead:

quay.io/gmod/docker-apollo:latest
hodgett commented 5 years ago

Yes, I did try that but the image did not rebuild and the '-e APOLLO_PATH=apollo' option did not work.

hodgett commented 5 years ago

Ok, I did a docker pull quay.io/gmod/docker-apollo:latest to get the latest, and now apollo is totally broken, just getting a blank screen. I'll try pruning everything and starting again.

hodgett commented 5 years ago

Sorry, it looks like the new option APOLLO_PATH=apollo doesn't work as expected. If I don't use it then I get the same functionality as before, but using it gets to the following but no further, Apollo just gives a blank screen. Have I missed something? Do I need to change the proxypass in apache?

`Configuring Shiro ...

Shiro Configured 2019-02-28 23:21:45,530 [localhost-startStop-1] ERROR hbm2ddl.SchemaUpdate - HHH000388: Unsuccessful: alter table chadoprop add column cvterm_id int8 not null 2019-02-28 23:21:45,531 [localhost-startStop-1] ERROR hbm2ddl.SchemaUpdate - ERROR: column "cvterm_id" contains null values 2019-02-28 23:21:45,542 [localhost-startStop-1] ERROR hbm2ddl.SchemaUpdate - HHH000388: Unsuccessful: alter table chadoprop add constraint FK_8twb5n8vjmldyy3eeyq7sppc3 foreign key (cvterm_id) references cvterm 2019-02-28 23:21:45,542 [localhost-startStop-1] ERROR hbm2ddl.SchemaUpdate - ERROR: column "cvterm_id" referenced in foreign key constraint does not exist Starting Quartz Scheduler in QuartzFactoryBean 2019-02-28 23:21:57,227 [localhost-startStop-1] WARN apollo.UserService - User exists admin@local.host and can not be added again. 2019-02-28 23:21:58,404 [localhost-startStop-1] WARN apollo.PhoneHomeService - Failed to phone home: org.springframework.transaction.HeuristicCompletionException: Heuristic completion: outcome state is mixed; nested exception is org.springframework.orm.hibernate4.HibernateOptimisticLockingFailureException: Object of class [org.bbop.apollo.ServerData] with identifier [97]: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) : [org.bbop.apollo.ServerData#97] 2019-02-28 23:21:58,448 [Actor Thread 3] ERROR apollo.PhoneHomeService - An error occured while phoning home Heuristic completion: outcome state is mixed; nested exception is org.springframework.orm.hibernate4.HibernateOptimisticLockingFailureException: Object of class [org.bbop.apollo.ServerData] with identifier [97]: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) : [org.bbop.apollo.ServerData#97] 28-Feb-2019 23:21:58.618 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive /var/lib/tomcat8/webapps/#apollo.war has finished in 53,454 ms`

nathandunn commented 5 years ago

sometimes it doesn't exit cleanly when it gets killed (and confirm others are killed), as it looks like it is locked on something (but the error doesn't look problematic). I'd wipe the containers and start it up with the proper options.

-e APOLLO_PATH:apollo -p 8888:8080

You should be able to connect via http://localhost:8888/apollo

WRT the proxypass, I have some documentation here: https://genomearchitect.readthedocs.io/en/latest/Configure.html?highlight=proxy#apache-nginx-configuration

But really, each installation is unique.

If you could provide the command details what link you checked, that would be helpful.

hodgett commented 5 years ago

Ok, all sorted, my fault. I also needed to append apollo to the proxypass statements in apache! Doh! So yes, your changes are work well, I can confirm now that all the links are working correctly. Thanks for all the help and for how quickly you did it!

nathandunn commented 5 years ago

No problem. It is a good feature to have. Thanks for being persistent.

On Feb 28, 2019, at 3:50 PM, hodgett notifications@github.com wrote:

Ok, all sorted, my fault. I also needed to append apollo to the proxypass statements in apache! Doh! So yes, your changes are work well, I can confirm now that all the links are working correctly. Thanks for all the help and for how quickly you did it!

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/GMOD/docker-apollo/issues/37#issuecomment-468486212, or mute the thread https://github.com/notifications/unsubscribe-auth/AAt2qsRTdD1NuPsLXjiFytEImKS6sOE3ks5vSGs9gaJpZM4bV84q.