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

Upgrade Nexus VM to larger machine… #213

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion templates/shared_services/sonatype-nexus-vm/porter.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
schemaVersion: 1.0.0
name: tre-shared-service-sonatype-nexus
version: 3.0.0
version: 3.0.1
description: "A Sonatype Nexus shared service"
dockerfile: Dockerfile.tmpl
registry: azuretre
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,18 @@ while true; do
((docker_pull_timeout--));
done

# Deduce memory available to Java. Either 3/4 of the system RAM, or a set minimum
# shellcheck disable=SC2002
mem_total_mb=$(( $(cat /proc/meminfo | head -1 | awk '{ print $2 }') / 1024 ))
java_mem=2703
if [ $mem_total_mb -gt 4096 ]; then
java_mem=$(( mem_total_mb * 3 / 4 ))
fi

echo "System memory: ${mem_total_mb} MB. Java memory: ${java_mem} MB"

docker run -d -p 80:8081 -p 443:8443 -p 8083:8083 -v /etc/nexus-data:/nexus-data \
-e INSTALL4J_ADD_VM_PARAMS="-Xmx${java_mem}m -Xms${java_mem}m" \
--restart always \
--name nexus \
--log-driver local \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ resource "azurerm_linux_virtual_machine" "nexus" {
resource_group_name = local.core_resource_group_name
location = data.azurerm_resource_group.rg.location
network_interface_ids = [azurerm_network_interface.nexus.id]
size = "Standard_B2s"
size = "Standard_B8ms"
disable_password_authentication = false
admin_username = "adminuser"
admin_password = random_password.nexus_vm_password.result
Expand Down
Loading