Skip to content

Commit

Permalink
Merge oes-gate into spinnaker gate
Browse files Browse the repository at this point in the history
  • Loading branch information
byrisettya committed Mar 11, 2021
2 parents a6a3359 + de08176 commit d742462
Show file tree
Hide file tree
Showing 123 changed files with 21,149 additions and 467 deletions.
18 changes: 9 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM registry.access.redhat.com/ubi8/ubi
MAINTAINER sig-platform@spinnaker.io
COPY ./gate-web/build/install/gate /opt/gate
RUN yum -y install java-11-openjdk-headless.x86_64 wget vim
RUN adduser spinnaker

RUN mkdir -p /opt/gate/plugins
USER spinnaker
CMD ["/opt/gate/bin/gate"]
FROM registry.access.redhat.com/ubi8/ubi
MAINTAINER sig-platform@spinnaker.io
COPY ./gate-web/build/install/gate /opt/gate
RUN yum -y install java-11-openjdk-headless.x86_64 wget vim
RUN adduser spinnaker

RUN mkdir -p /opt/gate/plugins
USER spinnaker
CMD ["/opt/gate/bin/gate"]
8 changes: 8 additions & 0 deletions Dockerfile.ubuntu-java8
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM ubuntu:bionic
MAINTAINER sig-platform@spinnaker.io
COPY gate-web/build/install/gate /opt/gate
RUN apt-get update && apt-get -y install openjdk-8-jre-headless wget
RUN adduser --disabled-login --system spinnaker
RUN mkdir -p /opt/gate/plugins && chown -R spinnaker:nogroup /opt/gate/plugins
USER spinnaker
CMD ["/opt/gate/bin/gate"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ providers, use the `includeProviders` flag:
To start the JVM in debug mode, set the Java system property `DEBUG=true`:

```
./gradlew -DDEBUG=true
./gradlew -DDEBUG=true
```

The JVM will then listen for a debugger to be attached on port 8184. The JVM will _not_ wait for
Expand Down
30 changes: 15 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ allprojects {

group = "com.netflix.spinnaker.gate"

if ([korkVersion, fiatVersion].find { it.endsWith('-SNAPSHOT') }) {
repositories {
mavenLocal()
}
}

if (name != "gate-bom" && name != "gate-api") {
if (name != "gate-bom") {
apply plugin: 'java-library'
apply plugin: 'groovy'

if ([korkVersion, fiatVersion].find { it.endsWith('-SNAPSHOT') }) {
repositories {
mavenLocal()
}
}

repositories {
maven { url 'https://build.shibboleth.net/nexus/content/repositories/releases/' }
maven { url 'https://repository.mulesoft.org/releases/' }
Expand Down Expand Up @@ -50,17 +50,17 @@ allprojects {
exclude group: 'javax.servlet', module: 'servlet-api'
exclude group: 'javax.servlet', module: 'javax.servlet-api'
}
}

tasks.withType(JavaExec) {
if (System.getProperty('DEBUG', 'false') == 'true') {
jvmArgs '-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8184'
tasks.withType(JavaExec) {
if (System.getProperty('DEBUG', 'false') == 'true') {
jvmArgs '-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8184'
}
}
}

test {
testLogging {
exceptionFormat = 'full'
test {
testLogging {
exceptionFormat = 'full'
}
}
}
}
Expand Down
31 changes: 31 additions & 0 deletions docker_build/Dockerfile.rhel8-ubi8
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM registry.access.redhat.com/ubi8/ubi:latest
MAINTAINER OpsMx
# Add user opsmx and create logs and spinnaker config directory
RUN adduser opsmx \
&& usermod -aG wheel opsmx \
&& mkdir /home/opsmx/logs \
&& mkdir -p /opt/spinnaker/config

# Install procps(ps)
RUN yum install -y procps
# Install java 8
RUN yum install -y java-1.8.0-openjdk.x86_64
# Install ping
RUN yum install -y iputils
#######Gate Dependencies#########
ENV WORK_DIR=/home/opsmx
ENV JAVA_HOME=/usr/lib/jvm/jre-1.8.0-openjdk
COPY /docker_build/run.sh /usr/local/bin/run.sh
RUN chmod +x /usr/local/bin/run.sh
COPY /docker_build/gate.yml /opt/spinnaker/config/
COPY /docker_build/startup.sh /home/opsmx/
RUN chmod +x /home/opsmx/startup.sh

# === Copy Gate Build Files ===
COPY /gate-web/build/install/gate /home/opsmx/gate
RUN chown -R opsmx:root ${WORK_DIR}/* /opt/*

# === Start Gate Service ===
USER opsmx
WORKDIR ${WORK_DIR}
CMD ["run.sh"]
47 changes: 47 additions & 0 deletions docker_build/gate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
services:
opsmx:
baseUrl: http://oes-api:8085
enabled: true
autopilot:
baseUrl: http://localhost:8090
enabled: true
platform:
baseUrl: http://localhost:8095
userGroupApiPath: /platformservice/v1/users/{username}/usergroups/importAndCache
enabled: true
dashboard:
baseUrl: http://localhost:8094
enabled: true
visibility:
baseUrl: http://localhost:8096
enabled: true
oesui:
externalUrl: http://150.238.22.102
security:
basic:
enabled: true
user: {}
cors:
allowed-origins-pattern: ^https?://(?:localhost|137.117.94.95)(?::[1-9]\d*)?/?
ldap:
enabled: true
url: ldap://localhost:389/DC=example,DC=com
userDnPattern: uid={0},ou=people
file:
enabled: false
url: /platformservice/v1/users/authenticate
authn:
mode: session
google: {}
logging:
level:
com.netflix.spinnaker.gate.security: DEBUG
org.springframework.security: DEBUG
org.springframework.web: DEBUG

redis:
connection: redis://spin-redis:6379

server:
session:
timeout-in-seconds: 7200
37 changes: 37 additions & 0 deletions docker_build/redis/Dockerfile.redis6.rhel8-ubi8
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM registry.access.redhat.com/ubi8/ubi:latest
MAINTAINER OpsMx

# Add user opsmx and create logs
RUN adduser opsmx \
&& mkdir /home/opsmx/logs

# Install procps(ps)
RUN yum install -y procps
# Install java 8
RUN yum install -y java-1.8.0-openjdk.x86_64

# Install redis 5 and its dependencies
RUN yum install -y wget
RUN yum install -y gcc
RUN yum install -y make

#######Redis Dependencies#########
ENV WORK_DIR=/home/opsmx
ENV JAVA_HOME=/usr/lib/jvm/jre-1.8.0-openjdk
COPY /docker_build/redis/run.sh /usr/local/bin/run.sh
RUN chmod +x /usr/local/bin/run.sh
COPY /docker_build/redis/startup.sh /home/opsmx/
RUN chmod +x /home/opsmx/startup.sh
RUN chown -R opsmx:root ${WORK_DIR}/*

# === Start Redis Service ===
USER opsmx
WORKDIR ${WORK_DIR}
RUN wget http://download.redis.io/releases/redis-6.0.1.tar.gz
RUN tar xzf redis-6.0.1.tar.gz
WORKDIR redis-6.0.1
RUN sed -i -e "s|bind 127.0.0.1|bind 0.0.0.0|" /home/opsmx/redis-6.0.1/redis.conf
RUN sed -i -e "s|protected-mode yes|protected-mode no|" /home/opsmx/redis-6.0.1/redis.conf
RUN make
WORKDIR ${WORK_DIR}
CMD ["run.sh"]
13 changes: 13 additions & 0 deletions docker_build/redis/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

${WORK_DIR}/redis-6.0.1/src/redis-server ${WORK_DIR}/redis-6.0.1/redis.conf | tee ${WORK_DIR}/logs/redis.log

cd ${WORK_DIR}
sleep 10

while :
do
sleep 100
# For Debugging, Docker should alive!
done
echo "redis services started ..."
15 changes: 15 additions & 0 deletions docker_build/redis/startup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

REDISID=`ps -ef | grep redis-server | grep -v grep | awk '{print $2}'`

echo "Redis Id : " $REDISID
if [ "" != "$REDISID" ]; then
kill -9 $REDISID
echo "Redis service killed.Starting a new one."
else
echo "No Redis service killed.Starting a new one."
fi
sleep 5
${WORK_DIR}/redis-6.0.1/src/redis-server ${WORK_DIR}/redis-6.0.1/redis.conf | tee ${WORK_DIR}/logs/redis.log
echo "Redis service Started"

14 changes: 14 additions & 0 deletions docker_build/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

${WORK_DIR}/gate/bin/gate | tee ${WORK_DIR}/logs/gate.log

cd ${WORK_DIR}
sleep 10

while :
do
sleep 100
# For Debugging, Docker should alive!
done

echo "gate services started ..."
14 changes: 14 additions & 0 deletions docker_build/startup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

GATEID=`ps -ef | grep java | grep -v grep | awk '{print $2}'`

echo "Gate Id : " $GATEID
if [ "" != "$GATEID" ]; then
kill -9 $GATEID
echo "Gate service killed.Starting a new one."
else
echo "No Gate service.Starting a new one."
fi
sleep 5
${WORK_DIR}/gate/bin/gate | tee ${WORK_DIR}/logs/gate.log
echo "Gate service Started"
2 changes: 0 additions & 2 deletions gate-api/gate-api.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ apply plugin: 'java-library'

dependencies {
implementation platform("com.netflix.spinnaker.kork:kork-bom:$korkVersion")
annotationProcessor platform("com.netflix.spinnaker.kork:kork-bom:$korkVersion")

api "com.netflix.spinnaker.kork:kork-plugins-api"
api "com.netflix.spinnaker.kork:kork-annotations"

Expand Down
5 changes: 3 additions & 2 deletions gate-core/gate-core.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ dependencies {
api "org.springframework.boot:spring-boot-starter-web"
api "org.springframework.boot:spring-boot-starter-actuator"
api "org.springframework.boot:spring-boot-starter-security"

api "org.springframework.boot:spring-boot-starter-thymeleaf"
api "com.squareup.retrofit:retrofit"

implementation "com.netflix.spinnaker.kork:kork-plugins"
implementation "com.jakewharton.retrofit:retrofit1-okhttp3-client:1.1.0"
implementation "com.squareup.retrofit:converter-jackson"
implementation "com.squareup.okhttp:okhttp"
Expand All @@ -36,7 +35,9 @@ dependencies {
implementation "com.netflix.spinnaker.kork:kork-security"
implementation "com.netflix.spectator:spectator-api"
implementation "com.github.ben-manes.caffeine:guava"
implementation "com.netflix.hystrix:hystrix-core"
implementation "org.apache.commons:commons-lang3"
implementation group: 'io.jsonwebtoken', name: 'jjwt', version: '0.9.1'
}

sourceSets {
Expand Down
Loading

0 comments on commit d742462

Please sign in to comment.