First set of files.
This commit is contained in:
parent
e3312b3588
commit
65294a8a27
|
@ -0,0 +1,11 @@
|
||||||
|
FROM d4science/rstudio-base:2023-03-R4-2
|
||||||
|
|
||||||
|
LABEL org.d4science.image.licenses="EUPL-1.2" \
|
||||||
|
org.d4science.image.source="https://code-repo.d4science.org/gCubeSystem/rstudio-d4science" \
|
||||||
|
org.d4science.image.vendor="D4Science <https://www.d4science.org>" \
|
||||||
|
org.d4science.image.authors="Andrea Dell'Amico <andrea.dellamico@isti.cnr.it>
|
||||||
|
|
||||||
|
COPY rsession.conf /etc/rstudio/rsession.conf
|
||||||
|
RUN chmod 0644 /etc/rstudio/rsession.conf
|
||||||
|
RUN curl -o "${R_HOME}/etc/Rprofile.site" "https://code-repo.d4science.org/gCubeSystem/rstudio-rprofile/raw/branch/master/jupyter-Rprofile.site"
|
||||||
|
|
|
@ -0,0 +1,66 @@
|
||||||
|
// REMEMBER TO FILL THE environment section with your values.
|
||||||
|
// the following filed should be filled: imagename, git_url
|
||||||
|
// REMEMBER to put your Dockerfile in the root folder of your project
|
||||||
|
// The related jenkinsjob template is here:
|
||||||
|
|
||||||
|
|
||||||
|
pipeline {
|
||||||
|
agent {
|
||||||
|
label 'docker'
|
||||||
|
}
|
||||||
|
environment {
|
||||||
|
imagename = "d4science/r-studio-test"
|
||||||
|
registryCredential = 'e348bfab-5580-4db6-b0e0-d854966bde08'
|
||||||
|
dockerImage = ''
|
||||||
|
git_url='https://code-repo.d4science.org/gCubeSystem/r-studio-test.git'
|
||||||
|
}
|
||||||
|
stages {
|
||||||
|
stage('Cloning Git') {
|
||||||
|
steps {
|
||||||
|
git([url: git_url, branch: 'master', credentialsId: '88b54962-1c0e-49cb-8155-22276860f346'])
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Building image') {
|
||||||
|
steps{
|
||||||
|
script {
|
||||||
|
dockerImage = docker.build imagename
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Deploy Image') {
|
||||||
|
steps{
|
||||||
|
script {
|
||||||
|
docker.withRegistry( '', registryCredential ) {
|
||||||
|
dockerImage.push("$BUILD_NUMBER")
|
||||||
|
dockerImage.push('latest')
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Remove Unused docker image') {
|
||||||
|
steps{
|
||||||
|
sh "docker rmi $imagename:$BUILD_NUMBER"
|
||||||
|
sh "docker rmi $imagename:latest"
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// post-build actions
|
||||||
|
post {
|
||||||
|
success {
|
||||||
|
echo 'The docker pipeline worked!'
|
||||||
|
emailext to: 'jenkinsbuilds@d4science.org',
|
||||||
|
subject: "[Jenkins DockerPipeline D4S] build ${currentBuild.fullDisplayName} worked",
|
||||||
|
body: "Build time: ${currentBuild.durationString}. See ${env.BUILD_URL}"
|
||||||
|
}
|
||||||
|
failure {
|
||||||
|
echo 'The docker pipeline has failed'
|
||||||
|
emailext attachLog: true,
|
||||||
|
to: 'jenkinsbuilds@d4science.org',
|
||||||
|
subject: "[Jenkins DockerPipeline D4S] build ${currentBuild.fullDisplayName} failed for image ${imagename}",
|
||||||
|
body: "Something is wrong with ${env.BUILD_URL}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,3 +1,6 @@
|
||||||
# rstudio-d4science
|
# rstudio-d4science
|
||||||
|
|
||||||
Rstudio docker images. Used through JupyterHub in the D4Science VREs.
|
Rstudio image that builds from "r-full"
|
||||||
|
|
||||||
|
One branch for each corresponding *major.minor* `R` version and for each
|
||||||
|
customization on top of the R version.
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# From https://github.com/jupyter/docker-stacks/blob/main/docker-stacks-foundation/fix-permissions
|
||||||
|
# set permissions on a directory
|
||||||
|
# after any installation, if a directory needs to be (human) user-writable,
|
||||||
|
# run this script on it.
|
||||||
|
# It will make everything in the directory owned by the group ${NB_GID}
|
||||||
|
# and writable by that group.
|
||||||
|
# Deployments that want to set a specific user id can preserve permissions
|
||||||
|
# by adding the `--group-add users` line to `docker run`.
|
||||||
|
|
||||||
|
# uses find to avoid touching files that already have the right permissions,
|
||||||
|
# which would cause massive image explosion
|
||||||
|
|
||||||
|
# right permissions are:
|
||||||
|
# group=${NB_GID}
|
||||||
|
# AND permissions include group rwX (directory-execute)
|
||||||
|
# AND directories have setuid,setgid bits set
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
for d in "$@"; do
|
||||||
|
find "${d}" \
|
||||||
|
! \( \
|
||||||
|
-group "${NB_GID}" \
|
||||||
|
-a -perm -g+rwX \
|
||||||
|
\) \
|
||||||
|
-exec chgrp "${NB_GID}" -- {} \+ \
|
||||||
|
-exec chmod g+rwX -- {} \+
|
||||||
|
# setuid, setgid *on directories only*
|
||||||
|
find "${d}" \
|
||||||
|
\( \
|
||||||
|
-type d \
|
||||||
|
-a ! -perm -6000 \
|
||||||
|
\) \
|
||||||
|
-exec chmod +6000 -- {} \+
|
||||||
|
done
|
|
@ -0,0 +1,11 @@
|
||||||
|
session-timeout-minutes=7200
|
||||||
|
session-disconnected-timeout-minutes=1440
|
||||||
|
session-quit-child-processes-on-exit=1
|
||||||
|
session-default-working-dir=~
|
||||||
|
session-default-new-project-dir=~
|
||||||
|
session-save-action-default=no
|
||||||
|
allow-shell=0
|
||||||
|
allow-terminal-websockets=0
|
||||||
|
limit-cpu-time-minutes=0
|
||||||
|
limit-file-upload-size-mb=0
|
||||||
|
limit-xfs-disk-quota=no
|
Loading…
Reference in New Issue