Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nmaas Platform
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nmaas
nmaas Platform
Commits
b833f949
Commit
b833f949
authored
4 months ago
by
Lukasz Lopatowski
Browse files
Options
Downloads
Patches
Plain Diff
Update Dockerfile and docker_entrypoint.sh to include Helm installation and initialization
parent
69f62bb4
No related branches found
No related tags found
1 merge request
!133
Resolve "Remove nmaas-helm interaction"
Pipeline
#93177
passed
4 months ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Dockerfile
+24
-5
24 additions, 5 deletions
Dockerfile
docker/docker_entrypoint.sh
+39
-0
39 additions, 0 deletions
docker/docker_entrypoint.sh
with
63 additions
and
5 deletions
Dockerfile
+
24
−
5
View file @
b833f949
...
@@ -4,20 +4,39 @@ COPY . /build/
...
@@ -4,20 +4,39 @@ COPY . /build/
WORKDIR
/build/
WORKDIR
/build/
RUN
chmod
+x ./gradlew
\
RUN
chmod
+x ./gradlew
\
&&
./gradlew
-Dorg
.gradle.daemon
=
false
build
&&
./gradlew
-Dorg
.gradle.daemon
=
false
build
-x
test
FROM
eclipse-temurin:17-jre-alpine
FROM
eclipse-temurin:17-jre-alpine
LABEL
maintainer=nmaas@lists.geant.org
LABEL
maintainer=nmaas@lists.geant.org
ARG
USERNAME=nmaas
ARG
USER_UID=1000
ARG
USER_GID=1000
# Note: Latest version of kubectl may be found at https://github.com/kubernetes/kubernetes/releases
ARG
KUBE_LATEST_VERSION="v1.16.3"
# Note: Latest version of helm may be found at https://github.com/kubernetes/helm/releases
ARG
HELM_VERSION="v3.9.3"
COPY
--from=builder /build/build/libs/*.jar /nmaas/platform/
COPY
--from=builder /build/build/libs/*.jar /nmaas/platform/
COPY
docker/
run_platform
.sh /nmaas/scripts/
run_platform
.sh
COPY
docker/
docker_entrypoint
.sh /nmaas/scripts/
docker_entrypoint
.sh
COPY
docker/logback.xml /nmaas/platform/config/logback.xml
COPY
docker/logback.xml /nmaas/platform/config/logback.xml
COPY
docker/do-ntp.sh /etc/periodic/hourly/do-ntp.sh
COPY
docker/do-ntp.sh /etc/periodic/hourly/do-ntp.sh
COPY
docker/ssh-config /root/.ssh/config
RUN
addgroup
-g
$USER_GID
$USERNAME
\
&&
adduser
--disabled-password
-u
$USER_UID
-G
$USERNAME
$USERNAME
RUN
apk
--no-cache
add gettext postgresql-client
\
RUN
apk
--no-cache
add gettext postgresql-client
\
&&
mkdir
/nmaas/files
\
&&
mkdir
/nmaas/files
\
&&
chmod
+x /nmaas/scripts/run_platform.sh
&&
chmod
+x /nmaas/scripts/docker_entrypoint.sh
\
&&
wget
-q
https://storage.googleapis.com/kubernetes-release/release/
${
KUBE_LATEST_VERSION
}
/bin/linux/amd64/kubectl
-O
/usr/local/bin/kubectl
\
&&
chmod
+x /usr/local/bin/kubectl
\
&&
wget
-q
https://get.helm.sh/helm-
${
HELM_VERSION
}
-linux-amd64
.tar.gz
-O
- |
tar
-xzO
linux-amd64/helm
>
/usr/local/bin/helm
\
&&
chmod
+x /usr/local/bin/helm
RUN
chown
-R
$USERNAME
:
$USERNAME
/nmaas/files
USER
$USERNAME
ENTRYPOINT
/nmaas/scripts/docker_entrypoint.sh
CMD
/nmaas/scripts/run_platform.sh && tail -f /dev/null
CMD
ls /home
\ No newline at end of file
\ No newline at end of file
This diff is collapsed.
Click to expand it.
docker/
run_platform
.sh
→
docker/
docker_entrypoint
.sh
+
39
−
0
View file @
b833f949
#!/bin/sh
#!/bin/sh
export
HELM_HOME
=
/home/nmaas/.helm
mkdir
-p
$HELM_HOME
helm repo add nmaas https://artifactory.software.geant.org/artifactory/nmaas-helm
helm repo add influxdata https://helm.influxdata.com/
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add jenkins https://charts.jenkins.io
cat
>>
/home/nmaas/.profile
<<
EOF
export HELM_HOME=
$HELM_HOME
export HELM_HOST=
$HELM_HOST
export TILLER_NAMESPACE=
$TILLER_NAMESPACE
export KUBERNETES_SERVICE_HOST=kubernetes.default
export KUBERNETES_SERVICE_PORT=443
EOF
DIR
=
/nmaas/platform
DIR
=
/nmaas/platform
FILE
=
$(
ls
$DIR
|
grep
.jar
)
FILE
=
$(
ls
$DIR
|
grep
.jar
)
cd
$DIR
cd
$DIR
mkdir
-p
/root/.ssh
cp
/nmaas/.ssh/id_rsa /root/.ssh/id_rsa
chmod
600 /root/.ssh/id_rsa
mkdir
-p
/nmaas/files/upload
mkdir
-p
/nmaas/files/upload
mkdir
-p
/nmaas/files/log
mkdir
-p
/nmaas/files/log
...
@@ -14,10 +29,11 @@ until PGPASSWORD=${POSTGRESQL_PASSWORD} psql -h "${POSTGRESQL_HOST}" -p ${POSTGR
...
@@ -14,10 +29,11 @@ until PGPASSWORD=${POSTGRESQL_PASSWORD} psql -h "${POSTGRESQL_HOST}" -p ${POSTGR
done
done
if
PGPASSWORD
=
${
POSTGRESQL_PASSWORD
}
psql
-h
"
${
POSTGRESQL_HOST
}
"
-p
${
POSTGRESQL_PORT
}
-U
"
${
POSTGRESQL_USERNAME
}
"
-lqt
|
cut
-d
\|
-f
1 |
grep
-qw
${
POSTGRESQL_DBNAME
}
;
then
if
PGPASSWORD
=
${
POSTGRESQL_PASSWORD
}
psql
-h
"
${
POSTGRESQL_HOST
}
"
-p
${
POSTGRESQL_PORT
}
-U
"
${
POSTGRESQL_USERNAME
}
"
-lqt
|
cut
-d
\|
-f
1 |
grep
-qw
${
POSTGRESQL_DBNAME
}
;
then
echo
"Database is already
setup
"
echo
"Database is already
exists
"
else
else
echo
"Database
is being created
..."
echo
"Database
needs to be created. Creating
..."
PGPASSWORD
=
${
POSTGRESQL_PASSWORD
}
createdb
${
POSTGRESQL_DBNAME
}
-h
"
${
POSTGRESQL_HOST
}
"
-p
${
POSTGRESQL_PORT
}
-U
"
${
POSTGRESQL_USERNAME
}
"
${
POSTGRESQL_DBNAME
}
PGPASSWORD
=
${
POSTGRESQL_PASSWORD
}
createdb
${
POSTGRESQL_DBNAME
}
-h
"
${
POSTGRESQL_HOST
}
"
-p
${
POSTGRESQL_PORT
}
-U
"
${
POSTGRESQL_USERNAME
}
"
${
POSTGRESQL_DBNAME
}
fi
fi
java
-Djava
.security.egd
=
file:/dev/./urandom
-Dlogging
.config
=
/nmaas/platform/config/logback.xml
-jar
$FILE
echo
"Running nmaas-platform ..."
java
-Djava
.security.egd
=
file:/dev/./urandom
-Dlogging
.config
=
/nmaas/platform/config/logback.xml
-jar
$FILE
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment