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

[area/documentation] (#162) Minimal infrastructure setup update #384

Merged
merged 14 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,5 @@ typescript/vrotsc-annotations/package-lock.json
.vscode/*

.flattened-pom.xml

infrastructure/.m2/repository
62 changes: 62 additions & 0 deletions infrastructure/.m2/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<servers>
<server>
<id>nexus</id>
VenelinBakalov marked this conversation as resolved.
Show resolved Hide resolved
<username>admin</username>
<password>VMware1!</password>
</server>
</servers>
<mirrors>
<mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf> <!-- Use '*' for all repositories or 'central,snapshots' to specify -->
<name>Mirror of Central Repository</name>
<url>https://repo1.maven.org/maven2/</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<repositories>
VenelinBakalov marked this conversation as resolved.
Show resolved Hide resolved
<repository>
<id>releases</id>
<name>pscoe</name>
VenelinBakalov marked this conversation as resolved.
Show resolved Hide resolved
<url>http://infra.corp.local/nexus/repository/maven-releases/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
github-advanced-security[bot] marked this conversation as resolved.
Fixed
Show resolved Hide resolved
<repository>
<id>snapshots</id>
<name>pscoe</name>
VenelinBakalov marked this conversation as resolved.
Show resolved Hide resolved
<url>http://infra.corp.local/nexus/repository/maven-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
Fixed Show fixed Hide fixed
</repositories>
</profile>
<profile>
<id>packaging</id>
<properties>
<keystoreGroupId>com.vmware.pscoe.build</keystoreGroupId>
<keystoreArtifactId>keystore.example</keystoreArtifactId>
<keystoreVersion>2.41.0</keystoreVersion>
<vroPrivateKeyPem>target/${keystoreArtifactId}-${keystoreVersion}/private_key.pem</vroPrivateKeyPem>
<vroCertificatePem>target/${keystoreArtifactId}-${keystoreVersion}/cert.pem</vroCertificatePem>
<vroKeyPass>VMware1!</vroKeyPass>
</properties>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
<activeProfile>packaging</activeProfile>
</activeProfiles>
</settings>
113 changes: 58 additions & 55 deletions infrastructure/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,85 +1,88 @@
version: "3"
services:
# NGINX reverse proxy server
nginx:
image: nginx:1.18.0
image: nginx
container_name: nginx
restart: always
networks:
infranet:
ipv4_address: 172.18.0.10
ipv4_address: 172.19.0.10
ports:
- "80:80"
- "443:443"
- 80:80 # Web Interface
hostname: "infra.corp.local"
volumes:
- "./nginx/conf.d:/etc/nginx/conf.d"
- "./nginx/vhost.d:/etc/nginx/vhost.d"
- "./nginx/html:/usr/share/nginx/html"
- "./nginx/certs:/etc/nginx/certs:ro"
- "./nginx/proxy.conf:/etc/nginx/proxy.conf:ro"
- "/var/log/nginx:/var/log/nginx"
# GitLab CE Git repository manager
- "./nginx:/etc/nginx/"
nexus:
image: sonatype/nexus3 # Linux
#image: klo2k/nexus3 # Mac
container_name: nexus
hostname: "nexus.corp.local"
environment:
NEXUS_CONTEXT: nexus
networks:
infranet:
ipv4_address: 172.19.0.11
extra_hosts:
- "gitlab.corp.local:172.19.0.12"
ports:
- 8081:8081 # Web Interfac
volumes:
- "nexus-data:/var/sonatype/work"
restart: always
ulimits:
nproc: 65535
nofile:
soft: 32000
hard: 40000
gitlab:
image: gitlab/gitlab-ce:12.10.3-ce.0
image: gitlab/gitlab-ce # Linux
#image: yrzr/gitlab-ce-arm64v8 # Mac
container_name: gitlab-ce
restart: always
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url "http://infra.corp.local/gitlab"
external_url 'http://infra.corp.local/gitlab'
networks:
infranet:
ipv4_address: 172.18.0.11
ipv4_address: 172.19.0.12
extra_hosts:
- "infra.corp.local:<DOCKER_HOST_IP>"
- "infra.corp.local:172.19.0.10"
ports:
- "127.0.0.1:8080:80"
- 8082:80 # Web Interface
- 8022:22 # SSH
VenelinBakalov marked this conversation as resolved.
Show resolved Hide resolved
hostname: "gitlab.corp.local"
volumes:
- "/srv/gitlab/config:/etc/gitlab"
- "/srv/gitlab/logs:/var/log/gitlab"
- "/srv/gitlab/data:/var/opt/gitlab"
# GitLab CI Runner for CI/CD integration
- "gitlab-config:/var/gitlab/config"
- "gitlab-data:/var/gitlab/data"
- "gitlab-log:/var/gitlab/log"
gitlab-runner:
image: pscoelab/vrbt-gitlab-runner:latest
image: gitlab-runner # Custom image build from the gitlab-runner directory
container_name: gitlab-runner
restart: always
hostname: "gitlab-runner.corp.local"
networks:
infranet:
ipv4_address: 172.18.0.12
extra_hosts:
- "infra.corp.local:172.18.0.10"
- "gitlab.corp.local:172.18.0.11"
- "artifactory.corp.local:172.18.0.13"
volumes:
- "/srv/gitlab-runner/config:/etc/gitlab-runner"
- "/srv/gitlab-runner/m2:/home/gitlab-runner/.m2"
- "/srv/gitlab-runner/opt:/var/opt"
- "/var/run/docker.sock:/var/run/docker.sock"
# JFrog Artifactory OSS for artifact management
artifactory:
image: docker.bintray.io/jfrog/artifactory-oss:6.19.1
container_name: artifactory
hostname: "artifactory.corp.local"
networks:
infranet:
ipv4_address: 172.18.0.13
ipv4_address: 172.19.0.13
extra_hosts:
- "gitlab.corp.local:172.18.0.11"
- "infra.corp.local:172.19.0.10"
- "nexus.corp.local:172.19.0.11"
- "gitlab.corp.local:172.19.0.12"
ports:
- 127.0.0.1:8081:8081
- 2811:2811
volumes:
- /data/artifactory:/var/opt/jfrog/artifactory
# Add extra Java options by uncommenting the following lines
# environment:
# - EXTRA_JAVA_OPTIONS=-Xmx4g
restart: always
ulimits:
nproc: 65535
nofile:
soft: 32000
hard: 40000
- "./.m2:/home/gitlab-runner/.m2"
- "gitlab-runner-config:/var/gitlab-runner/config"
- "gitlab-runner-opt:/var/gitlab-runner/opt"
- "/var/run/docker.sock:/var/run/docker.sock"
volumes:
nexus-data: {}
gitlab-config: {}
gitlab-data: {}
gitlab-log: {}
gitlab-runner-config: {}
gitlab-runner-opt: {}
networks:
infranet:
external: true
infranet:
driver: bridge
ipam:
config:
- subnet: 172.19.0.0/24
6 changes: 0 additions & 6 deletions infrastructure/etc/hosts

This file was deleted.

20 changes: 20 additions & 0 deletions infrastructure/gitlab-runner/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM gitlab/gitlab-runner:latest

RUN apt-get update
RUN apt-get install -y curl
RUN apt-get install -y openjdk-17-jdk
RUN apt-get install -y software-properties-common
RUN apt-get install -y maven

# Install Node.js (npm is included in the package)
RUN curl -fsSL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get install -y nodejs

# Print the versions
RUN node -v
RUN npm -v
RUN mvn -v
RUN java --version

# Clean up the package lists to reduce image size
RUN rm -rf /var/lib/apt/lists/*
Loading
Loading