Update to mariad and openldap

This commit is contained in:
Aditya Ujeniya 2025-01-28 21:54:48 +01:00
parent 84a96b1318
commit 0edb94da94
4 changed files with 125 additions and 8 deletions

View File

@ -175,7 +175,7 @@
"directory": "/data/archive" "directory": "/data/archive"
}, },
"http-api": { "http-api": {
"address": "localhost:8082", "address": "0.0.0.0:8084",
"https-cert-file": null, "https-cert-file": null,
"https-key-file": null "https-key-file": null
}, },

77
config.json Normal file
View File

@ -0,0 +1,77 @@
{
"addr": "127.0.0.1:8080",
"short-running-jobs-duration": 300,
"archive": {
"kind": "file",
"path": "./var/job-archive"
},
"jwts": {
"max-age": "2000h"
},
"db-driver": "mysql",
"db": "root:root@tcp(0.0.0.0:3306)/ccbackend",
"ldap": {
"url": "ldap://0.0.0.0",
"user_base": "ou=users,dc=example,dc=com",
"search_dn": "cn=admin,dc=example,dc=com",
"user_bind": "uid={username},ou=users,dc=example,dc=com",
"user_filter": "(&(objectclass=posixAccount))",
"syncUserOnLogin": true
},
"enable-resampling": {
"trigger": 30,
"resolutions": [
600,
300,
120,
60
]
},
"emission-constant": 317,
"clusters": [
{
"name": "fritz",
"metricDataRepository": {
"kind": "cc-metric-store",
"url": "http://0.0.0.0:8084",
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSJ9.eyJ1c2VyIjoiYWRtaW4iLCJyb2xlcyI6WyJST0xFX0FETUlOIiwiUk9MRV9BTkFMWVNUIiwiUk9MRV9VU0VSIl19.d-3_3FZTsadPjDEdsWrrQ7nS0edMAR4zjl-eK7rJU3HziNBfI9PDHDIpJVHTNN5E5SlLGLFXctWyKAkwhXL-Dw"
},
"filterRanges": {
"numNodes": {
"from": 1,
"to": 64
},
"duration": {
"from": 0,
"to": 86400
},
"startTime": {
"from": "2022-01-01T00:00:00Z",
"to": null
}
}
},
{
"name": "alex",
"metricDataRepository": {
"kind": "cc-metric-store",
"url": "http://0.0.0.0:8084",
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSJ9.eyJ1c2VyIjoiYWRtaW4iLCJyb2xlcyI6WyJST0xFX0FETUlOIiwiUk9MRV9BTkFMWVNUIiwiUk9MRV9VU0VSIl19.d-3_3FZTsadPjDEdsWrrQ7nS0edMAR4zjl-eK7rJU3HziNBfI9PDHDIpJVHTNN5E5SlLGLFXctWyKAkwhXL-Dw"
},
"filterRanges": {
"numNodes": {
"from": 1,
"to": 64
},
"duration": {
"from": 0,
"to": 86400
},
"startTime": {
"from": "2022-01-01T00:00:00Z",
"to": null
}
}
}
]
}

View File

@ -40,9 +40,15 @@ services:
image: osixia/openldap:1.5.0 image: osixia/openldap:1.5.0
command: --copy-service --loglevel debug command: --copy-service --loglevel debug
environment: environment:
- LDAP_ADMIN_PASSWORD=${LDAP_ADMIN_PASSWORD} - LDAP_ADMIN_PASSWORD=mashup
- LDAP_ORGANISATION=${LDAP_ORGANISATION} - LDAP_ORGANISATION=Example Organization
- LDAP_DOMAIN=${LDAP_DOMAIN} - LDAP_DOMAIN=example.com
- LDAP_LOGGING=true
- LDAP_CONNECTION=default
- LDAP_CONNECTIONS=default
- LDAP_DEFAULT_HOSTS=0.0.0.0
ports:
- "0.0.0.0:389:389"
volumes: volumes:
- ${DATADIR}/ldap:/container/service/slapd/assets/config/bootstrap/ldif/custom - ${DATADIR}/ldap:/container/service/slapd/assets/config/bootstrap/ldif/custom
@ -51,15 +57,14 @@ services:
image: mariadb:latest image: mariadb:latest
command: ["--default-authentication-plugin=mysql_native_password"] command: ["--default-authentication-plugin=mysql_native_password"]
environment: environment:
MARIADB_ROOT_PASSWORD: ${MARIADB_ROOT_PASSWORD} MARIADB_ROOT_PASSWORD: root
MARIADB_DATABASE: slurm_acct_db MARIADB_DATABASE: slurm_acct_db
MARIADB_USER: slurm MARIADB_USER: slurm
MARIADB_PASSWORD: demo MARIADB_PASSWORD: demo
ports: ports:
- "127.0.0.1:${MARIADB_PORT}:3306" - "0.0.0.0:${MARIADB_PORT}:3306"
volumes: volumes:
- ${DATADIR}/mariadb:/etc/mysql/conf.d - ${DATADIR}/mariadb:/docker-entrypoint-initdb.d
# - ${DATADIR}/sql-init:/docker-entrypoint-initdb.d
cap_add: cap_add:
- SYS_NICE - SYS_NICE

View File

@ -73,6 +73,39 @@ fi
# rm -r ./data/job-archive-source # rm -r ./data/job-archive-source
# rm -r ./data/cc-metric-store-source # rm -r ./data/cc-metric-store-source
if [ ! -d data/mariadb ]; then
mkdir -p data/mariadb
cat > data/mariadb/01.databases.sql <<EOF
CREATE DATABASE IF NOT EXISTS \`ccbackend\`;
EOF
else
echo "'data/mariadb' already exists!"
fi
if [ ! -d data/ldap ]; then
mkdir -p data/ldap
cat > data/ldap/add_users.ldif <<EOF
dn: ou=users,dc=example,dc=com
objectClass: organizationalUnit
ou: users
dn: uid=ldapuser,ou=users,dc=example,dc=com
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: top
cn: Ldap User
sn: User
uid: ldapuser
uidNumber: 1
gidNumber: 1
homeDirectory: /home/ldapuser
userPassword: {SSHA}sQRqFQtuiupej7J/rbrQrTwYEHDduV+N
EOF
else
echo "'data/ldap' already exists!"
fi
# prepare folders for influxdb2 # prepare folders for influxdb2
if [ ! -d data/influxdb ]; then if [ ! -d data/influxdb ]; then
mkdir -p data/influxdb/data mkdir -p data/influxdb/data
@ -100,6 +133,8 @@ cd ../..
docker-compose build docker-compose build
docker-compose up -d docker-compose up -d
cp -f config.json cc-backend/config.json
echo "" echo ""
echo "|--------------------------------------------------------------------------------------|" echo "|--------------------------------------------------------------------------------------|"
echo "| Check logs for each slurm service by using these commands: |" echo "| Check logs for each slurm service by using these commands: |"