Skip to content

Commit

Permalink
Make docker deployment work
Browse files Browse the repository at this point in the history
Now solr-update and rocrate-preview-generator is also built and run
via docker-compose-dev.yml.

NOTE: for some reason for both of these 2 instances are run, although just
one them are actually properly configured with envs and ports. Don't know
the reasons for this.
  • Loading branch information
beepsoft committed Nov 9, 2023
1 parent b0da61a commit 0f78e6d
Show file tree
Hide file tree
Showing 3 changed files with 137 additions and 1 deletion.
22 changes: 22 additions & 0 deletions README.dsd.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# RRunning in docker

Full reset:

```
rm -rf ./docker-dev-volumes
docker images | grep 'gdcc/' | awk '{print $3}' | xargs docker rmi -f
```

Build once:

```
mvn -Pct -f modules/container-base install
```

Build and run:

```
mvn -Pct clean package
mvn -Pct docker:run
```


# branch: datasetfieldtype-refact

Expand Down
25 changes: 25 additions & 0 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,31 @@ services:
volumes:
- './conf/keycloak/oidc-realm.json:/opt/keycloak/data/import/oidc-realm.json'

# IMPORTANT: names must match alias/name in pom.xml!!
dev_arp_solr_updater:
image: gdcc/arp-solr-updater:unstable
container_name: "dev_arp_solr_updater"
hostname: arp_solr_updater
environment:
- DATAVERSE_URL=http://dataverse:8080
- SOLR_URL=http://solr:8983
- SOLR_SCHEMA_XML_PATH=/var/solr/data/collection1/conf/schema.xml
networks:
- dataverse
ports:
- '8984:3000'
volumes:
- ./docker-dev-volumes/solr/data:/var/solr

dev_arp_rocrate_preview_generator:
image: gdcc/arp-rocrate-preview-generator:unstable
container_name: "dev_arp_rocrate_preview_generator"
hostname: arp_rocrate_preview_generator
networks:
- dataverse
ports:
- '8985:8082'

networks:
dataverse:
driver: bridge
91 changes: 90 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,13 @@
<base.image.tag>unstable</base.image.tag>
<conf.image>gdcc/configbaker:${conf.image.tag}</conf.image>
<conf.image.tag>${app.image.tag}</conf.image.tag>


<!-- ARP specific -->
<arp.solr_updater.image>gdcc/arp-solr-updater:${arp.solr_updater.image.tag}</arp.solr_updater.image>
<arp.solr_updater.image.tag>${app.image.tag}</arp.solr_updater.image.tag>
<arp.rocrate_preview_generator.image>gdcc/arp-rocrate-preview-generator:${arp.rocrate_preview_generator.image.tag}</arp.rocrate_preview_generator.image>
<arp.rocrate_preview_generator.image.tag>${app.image.tag}</arp.rocrate_preview_generator.image.tag>

<docker.platforms></docker.platforms>

<!-- Variables as used in docker-compose.yml -->
Expand Down Expand Up @@ -901,6 +907,39 @@
<skip>true</skip>
</run>
</image>

<!--
___ ____ ____
/ | / __ \/ __ \
/ /| | / /_/ / /_/ /
/ ___ |/ _, _/ ____/
/_/ |_/_/ |_/_/
-->
<image>
<alias>dev_arp_solr_updater</alias>
<name>${arp.solr_updater.image}</name>
<build>
<buildx>
<platforms>
<platform>${docker.platforms}</platform>
</platforms>
</buildx>
<dockerFile>${project.basedir}/modules/arp-solr-updater/Dockerfile</dockerFile>
</build>
</image>
<image>
<alias>dev_arp_rocrate_preview_generator</alias>
<name>${arp.rocrate_preview_generator.image}</name>
<build>
<buildx>
<platforms>
<platform>${docker.platforms}</platform>
</platforms>
</buildx>
<dockerFile>${project.basedir}/modules/arp-rocrate-preview-generator/Dockerfile</dockerFile>
</build>
</image>

</images>
<autoCreateCustomNetworks>true</autoCreateCustomNetworks>
</configuration>
Expand All @@ -925,6 +964,56 @@
</execution>
</executions>
</plugin>

<!--
___ ____ ____
/ | / __ \/ __ \
/ /| | / /_/ / /_/ /
/ ___ |/ _, _/ ____/
/_/ |_/_/ |_/_/
-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>git-clone-arp-modules</id>
<phase>generate-sources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>bash</executable>
<arguments>
<argument>-c</argument>
<argument>
<![CDATA[
if [ ! -d "modules/arp-solr-updater" ]; then
echo "Cloning solr-updater to modules/arp-solr-updater"
git clone git@git.sztaki.hu:dsd/dataverse-solr-updater.git modules/arp-solr-updater
else
echo "Updating modules/arp-solr-updater"
cd modules/arp-solr-updater
git pull
fi
if [ ! -d "modules/arp-rocrate-preview-generator" ]; then
echo "Cloning dataverse-rocrate-preview to modules/arp-rocrate-preview-generator"
git clone git@git.sztaki.hu:dsd/dataverse-rocrate-preview.git modules/arp-rocrate-preview-generator
else
echo "Updating modules/arp-rocrate-preview-generator"
cd modules/arp-rocrate-preview-generator
git pull
fi
]]>
</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
Expand Down

0 comments on commit 0f78e6d

Please sign in to comment.