OPENDAP / hyrax-docker

GNU Lesser General Public License v3.0
22 stars 12 forks source link

getting started #41

Closed epifanio closed 1 year ago

epifanio commented 3 years ago

Hi,

I am trying to set up a hyrax opendap service, including ncwms, I kindly need an help in getting started.

I have cloned the repository and built the docker images using the provided - developer.yml

docker-compose -f developer.yml build

I only applied changes in the 'volumes/logs' configuration, so to let docker handle the log files. My developer.yml looks like this:

---
version: '3'
services:
  olfs:
    build: ./olfs
    build: 
        context: ./olfs
        args:
            DEVELOPER_MODE: "true"
            USE_NCWMS: "true"
    env_file: ${PWD}/local.env
    image: olfs:latest
    ports:
     - "80:8080"
    tty: true
    volumes:
     - olfs_tomcat:/usr/local/tomcat/logs
     - olfs_logs:/usr/local/tomcat/webapps/opendap/WEB-INF/conf/logs
    # command: -n http://localhost:8080 # This is the publicly accessible host for ncWMS
  besd:
    build: ./besd
    env_file: ${PWD}/local.env
    image: besd:latest
    ports:
     - "10022:10022"
    volumes:
      - besd_logs:/var/log/bes/
    #  - ./cache:/var/cache/bes  # maps the BES cache directory to the local filesystem
    #  - ./conf:/etc/bes # Maps a local BES configuration directory onto the bes in docker.
    # command: -e admin_contact@email.org -s
  ncwms:
    build: 
        context: ./ncWMS
        args:
            DEVELOPER_MODE: "true"
    env_file: ${PWD}/local.env
    image: ncwms:latest
    ports:
     - "8080:8080"
    tty: true
    volumes:
     - ncwms_tomcat:/usr/local/tomcat/logs
     - ncwms_logs:/root/.ncWMS2/logs

volumes:
  olfs_tomcat:
  olfs_logs:
  besd_logs:
  ncwms_tomcat:
  ncwms_logs:

While my local.env looks like this:

FOLLOW_SYMLINKS=Yes
NCWMS_BASE=http://localhost:8080/

I can start the whole infrastructure with:

docker-compose -f developer.yml up

Which return:

epinux@epinux:~/dev/hyrax-docker/hyrax-1.16.3$ docker-compose -f developer.yml up
Creating volume "hyrax-1163_olfs_tomcat" with default driver
Creating volume "hyrax-1163_olfs_logs" with default driver
Creating volume "hyrax-1163_besd_logs" with default driver
Creating volume "hyrax-1163_ncwms_tomcat" with default driver
Creating volume "hyrax-1163_ncwms_logs" with default driver
Recreating hyrax-1163_olfs_1  ... done
Recreating hyrax-1163_besd_1  ... done
Recreating hyrax-1163_ncwms_1 ... done
Attaching to hyrax-1163_besd_1, hyrax-1163_olfs_1, hyrax-1163_ncwms_1
ncwms_1  | ############################## ncWMS ##################################
ncwms_1  | Greetings, I am root.
ncwms_1  | CATALINA_HOME: /usr/local/tomcat
ncwms_1  | Using CATALINA_BASE:   /usr/local/tomcat
ncwms_1  | Using CATALINA_HOME:   /usr/local/tomcat
ncwms_1  | Using CATALINA_TMPDIR: /usr/local/tomcat/temp
ncwms_1  | Using JRE_HOME:        /docker-java-home/jre
ncwms_1  | Using CLASSPATH:       /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
ncwms_1  | Using Security Manager
ncwms_1  | Tomcat started.
ncwms_1  | tomcat_info: root           1       0  3 13:19 pts/0    00:00:00 /bin/bash /entrypoint.sh -
ncwms_1  | root          15       1  0 13:19 pts/0    00:00:00 /docker-java-home/jre/bin/java -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Dignore.endorsed.dirs= -classpath /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar -Djava.security.manager -Djava.security.policy==/usr/local/tomcat/conf/catalina.policy -Dcatalina.base=/usr/local/tomcat -Dcatalina.home=/usr/local/tomcat -Djava.io.tmpdir=/usr/local/tomcat/temp org.apache.catalina.startup.Bootstrap start
ncwms_1  | root          16       1  0 13:19 pts/0    00:00:00 /bin/bash /entrypoint.sh -
ncwms_1  | root          17      16  0 13:19 pts/0    00:00:00 ps -f
ncwms_1  | root          18      16  0 13:19 pts/0    00:00:00 grep - status: 0
ncwms_1  | Tomcat Has Arrived. (pid: 1)
besd_1   | ############################## BESD ##################################
olfs_1   | ############################## OLFS ##################################
olfs_1   | Greetings, I am root.
olfs_1   | Found exisiting NCWMS_BASE: http://localhost:8080/
olfs_1   | Using CATALINA_BASE:   /usr/local/tomcat
olfs_1   | Using CATALINA_HOME:   /usr/local/tomcat
olfs_1   | Using CATALINA_TMPDIR: /usr/local/tomcat/temp
olfs_1   | Using JRE_HOME:        /usr/local/openjdk-8
olfs_1   | Using CLASSPATH:       /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
olfs_1   | Using CATALINA_OPTS:   
olfs_1   | Tomcat started.
olfs_1   | Launched Tomcat.
olfs_1   | tomcat_info: root          15       1  0 13:19 pts/0    00:00:00 /usr/local/openjdk-8/bin/java -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Dignore.endorsed.dirs= -classpath /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/tomcat -Dcatalina.home=/usr/local/tomcat -Djava.io.tmpdir=/usr/local/tomcat/temp org.apache.catalina.startup.Bootstrap start
olfs_1   | root          18      16  0 13:19 pts/0    00:00:00 grep /usr/local/tomcat/bin/tomcat-juli.jar - status: 0
olfs_1   | Tomcat Has Arrived. (pid: 15)
besd_1   | Greetings, I am root.
besd_1   | SERVER_HELP_EMAIL is not_set
besd_1   | Found exisiting FOLLOW_SYMLINKS: Yes
besd_1   | Setting BES FollowSymLinks to YES.
besd_1   | Starting the BES
besd_1   | OK: Successfully started the BES
besd_1   | 18
besd_1   | The besdaemon is UP! pid: 18
besd_1   | BES Has Arrived...

At this point, I can successfully access the hyrax opendap interface, but I am still missing instructions on how to configure the ncWMS service.

My best guess is that I still need to add the data resources in the ncWMS configuration file, but which one? and what to add in it?

I see there are two ncWMS_config.xml files one in hyrax/ncWMS_config.xml and a second one in ncWMS/ncWMS_config.xml

I tried to uncomment the line 4-6 in both files

When accessing a data resource, for instance:

http://localhost/opendap/viewers/viewers?dapService=/opendap/hyrax&datasetID=/data/nc/coads_climatology.nc

The DAP service works fine, but the Web Mapping Service request:

http://localhost:8080//ncWMS2/wms/lds/data/nc/coads_climatology.nc?SERVICE=WMS&REQUEST=GetCapabilities&VERSION=1.3.0

returns:

javax.servlet.ServletException: ncWMS configuration object is null
    uk.ac.rdg.resc.edal.ncwms.NcwmsServlet.init(NcwmsServlet.java:101)
    sun.reflect.GeneratedMethodAccessor44.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke(Method.java:498)
    org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:282)
    org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:279)
    java.security.AccessController.doPrivileged(Native Method)
    javax.security.auth.Subject.doAsPrivileged(Subject.java:549)
    org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:314)
    org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:170)
    org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:123)
    org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
    org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:660)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
    org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798)
    org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:808)
    org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
    org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    java.lang.Thread.run(Thread.java:748)

Do you have any clue on what I am missing/doing wrong? perhaps the url/port configuration in the env file? Do you have a sample file I can use with the default example data sources shipped within the hyrax docker container?

Thanks for any pointer.

ndp-opendap commented 3 years ago

Hi Epifanio,

Here are the instructions for setting up ncWMS and Hyrax:

You might also consider using our docker images on docker hub.

You can run the server components in separate containers:

Or in a single one:

If you need more assistance please let me know!

Sincerely,

Nathan

epifanio commented 3 years ago

Hi Nathan, thank you for the pointers!

I get the hyrax_ncwms container up and running with zero issues, great! I will look into the configuration found on the image to learn how to expose my own data to the WMS and WCS services.

My aim is to run the services, separately, in the same docker-compose environment. I will work on this and let you know how it goes.

Thanks for helping out!