Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7112 payara5 aio #7114

Merged
merged 7 commits into from
Aug 4, 2020
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 5 additions & 12 deletions conf/docker-aio/0prep_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,11 @@ if [ ! -d dv/deps ]; then
mkdir -p dv/deps
fi
wdir=`pwd`
if [ ! -e dv/deps/glassfish4dv.tgz ]; then
echo "glassfish dependency prep"
mkdir -p /tmp/dv-prep/gf
cd /tmp/dv-prep/gf
wget http://download.java.net/glassfish/4.1/release/glassfish-4.1.zip
wget https://search.maven.org/remotecontent?filepath=org/jboss/weld/weld-osgi-bundle/2.2.10.Final/weld-osgi-bundle-2.2.10.Final-glassfish4.jar -O weld-osgi-bundle-2.2.10.Final-glassfish4.jar
unzip glassfish-4.1.zip
rm glassfish4/glassfish/modules/weld-osgi-bundle.jar
mv weld-osgi-bundle-2.2.10.Final-glassfish4.jar glassfish4/glassfish/modules
tar zcf $wdir/dv/deps/glassfish4dv.tgz glassfish4
cd $wdir
# assuming that folks usually have /tmp auto-clean as needed

if [ ! -e dv/deps/payara-5.2020.2.zip ]; then
echo "payara dependency prep"
# no more fiddly patching :)
Copy link
Member

Choose a reason for hiding this comment

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

Hooray! 🎉

wget https://github.com/payara/Payara/releases/download/payara-server-5.2020.2/payara-5.2020.2.zip -O dv/deps/payara-5.2020.2.zip
fi

if [ ! -e dv/deps/solr-7.7.2dv.tgz ]; then
Expand Down
17 changes: 8 additions & 9 deletions conf/docker-aio/c7.dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
FROM centos:7
# OS dependencies
RUN yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
#RUN yum install -y java-1.8.0-openjdk-headless postgresql-server sudo epel-release unzip perl curl httpd
RUN yum install -y java-1.8.0-openjdk-devel postgresql96-server sudo epel-release unzip perl curl httpd
RUN yum install -y jq lsof awscli

# copy and unpack dependencies (solr, glassfish)
# copy and unpack dependencies (solr, payara)
COPY dv /tmp/dv
COPY testdata/schema*.xml /tmp/dv/
COPY testdata/solrconfig.xml /tmp/dv
Expand All @@ -18,10 +17,10 @@ COPY disableipv6.conf /etc/sysctl.d/
RUN rm /etc/httpd/conf/*
COPY httpd.conf /etc/httpd/conf
RUN cd /opt ; tar zxf /tmp/dv/deps/solr-7.7.2dv.tgz
RUN cd /opt ; tar zxf /tmp/dv/deps/glassfish4dv.tgz
RUN cd /opt ; unzip /tmp/dv/deps/payara-5.2020.2.zip ; ln -s /opt/payara5 /opt/glassfish4

# this copy of domain.xml is the result of running `asadmin set server.monitoring-service.module-monitoring-levels.jvm=LOW` on a default glassfish installation (aka - enable the glassfish REST monitir endpoint for the jvm`
COPY domain-restmonitor.xml /opt/glassfish4/glassfish/domains/domain1/config/domain.xml
COPY domain-restmonitor.xml /opt/payara5/glassfish/domains/domain1/config/domain.xml

#RUN sudo -u postgres /usr/bin/initdb -D /var/lib/pgsql/data
RUN sudo -u postgres /usr/pgsql-9.6/bin/initdb -D /var/lib/pgsql/data
Expand All @@ -32,15 +31,15 @@ RUN cp -r /opt/solr-7.7.2/server/solr/configsets/_default /opt/solr-7.7.2/server
RUN cp /tmp/dv/schema*.xml /opt/solr-7.7.2/server/solr/collection1/conf/
RUN cp /tmp/dv/solrconfig.xml /opt/solr-7.7.2/server/solr/collection1/conf/solrconfig.xml

# skipping glassfish user and solr user (run both as root)
# skipping payara user and solr user (run both as root)

#solr port
EXPOSE 8983

# postgres port
EXPOSE 5432

# glassfish port
# payara port
EXPOSE 8080

# apache port, http
Expand All @@ -52,8 +51,8 @@ EXPOSE 9009

RUN mkdir /opt/dv

# yeah - still not happy if glassfish isn't in /usr/local :<
RUN ln -s /opt/glassfish4 /usr/local/glassfish4
# keeping the symlink on the off chance that something else is still assuming /usr/local/glassfish4
RUN ln -s /opt/payara5 /usr/local/glassfish4
Copy link
Member

Choose a reason for hiding this comment

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

I assume it's safe to not create this symlink. But it doesn't hurt to leave it in. I'm glad the comment was updated to described what's going on.

COPY dv/install/ /opt/dv/
COPY install.bash /opt/dv/
COPY entrypoint.bash /opt/dv/
Expand All @@ -76,7 +75,7 @@ ENV doi_username=${doi_username}
ENV doi_password=${doi_password}
COPY configure_doi.bash /opt/dv

# healthcheck for glassfish only (assumes modified domain.xml);
# healthcheck for payara only (assumes modified domain.xml);
# does not check dataverse application status.
HEALTHCHECK CMD curl --fail http://localhost:4848/monitoring/domain/server.json || exit 1
CMD ["/opt/dv/entrypoint.bash"]
6 changes: 3 additions & 3 deletions conf/docker-aio/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Also usable for normal development and system evaluation; not intended for produ


### Initial setup (aka - do once):
- `cd conf/docker-aio` and run `./0prep_deps.sh` to created Glassfish and Solr tarballs in `conf/docker-aio/dv/deps`.
- `cd conf/docker-aio` and run `./0prep_deps.sh` to created Payara and Solr tarballs in `conf/docker-aio/dv/deps`.

### Per-build:

Expand All @@ -29,7 +29,7 @@ Also usable for normal development and system evaluation; not intended for produ
- `cd conf/docker-aio`, and run `./1prep.sh` to copy files for integration test data into docker build context; `1prep.sh` will also build the war file and installation zip file
- build the docker image: `docker build -t dv0 -f c7.dockerfile .`

- Run image: `docker run -d -p 8083:8080 -p 8084:80 --name dv dv0` (aka - forward port 8083 locally to 8080 in the container for glassfish, and 8084 to 80 for apache); if you'd like to connect a java debugger to glassfish, use `docker run -d -p 8083:8080 -p 8084:80 -p 9010:9009 --name dv dv0`
- Run image: `docker run -d -p 8083:8080 -p 8084:80 --name dv dv0` (aka - forward port 8083 locally to 8080 in the container for payara, and 8084 to 80 for apache); if you'd like to connect a java debugger to payara, use `docker run -d -p 8083:8080 -p 8084:80 -p 9010:9009 --name dv dv0`

- Installation (integration test): `docker exec dv /opt/dv/setupIT.bash`
(Note that it's possible to customize the installation by editing `conf/docker-aio/default.config` and running `docker exec dv /opt/dv/install.bash` but for the purposes of integration testing, the `setupIT.bash` script above works fine.)
Expand All @@ -55,6 +55,6 @@ There isn't any strict requirement on the local port (8083, 8084 in this doc), t
```
run something like `docker ps -a | grep dv` to see the container left over from the last run and something like `docker rm 5f72a45b68c8` to remove it. Then try the `docker run` command above again.

* `empty reply from server` or `Failed to connect to ::1: Cannot assign requested address` tend to indicate either that you haven't given glassfish enough time to start, or your docker setup is in an inconsistent state and should probably be restarted.
* `empty reply from server` or `Failed to connect to ::1: Cannot assign requested address` tend to indicate either that you haven't given payara enough time to start, or your docker setup is in an inconsistent state and should probably be restarted.

* For manually fiddling around with the created dataverse, use user `dataverseAdmin` with password `admin1`.