Skip to content

Commit 391783e

Browse files
committed
Update config to be quicker to set up later
1 parent f01c31a commit 391783e

4 files changed

Lines changed: 17 additions & 22 deletions

File tree

SpiNNaker-allocserv/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# Use Ubuntu
1616
FROM ubuntu:noble
1717

18-
RUN apt update && apt install -y openjdk-21-jdk-headless maven git ping
18+
RUN apt update && apt install -y openjdk-21-jdk-headless maven git iputils-ping
1919

2020
# Set the working directory in the container
2121
WORKDIR /app

SpiNNaker-allocserv/docker-compose.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,23 @@ services:
1616
spalloc-mysql-db:
1717
image: mysql:8.0
1818
container_name: spalloc-mysql-container
19-
env_file: spalloc.env
19+
environment:
20+
SPRING_DATASOURCE_USERNAME: spalloc
21+
SPRING_DATASOURCE_PASSWORD: spalloc
22+
MYSQL_ROOT_PASSWORD: spalloc-root
2023
healthcheck:
21-
test: ["CMD", "/usr/bin/mysql", "--database=spalloc_history", "--user=$$SPRING_DATASOURCE_USERNAME", "--password=$$SPRING_DATASOURCE_PASSWORD", "--execute", "SHOW DATABASES;"]
22-
interval: 2s
23-
timeout: 2s
24-
retries: 100
24+
test: ["CMD", "/usr/bin/mysql", "--database=spalloc_history", "--user=spalloc", "--password=spalloc", "--execute", "SHOW DATABASES;"]
25+
interval: 2s
26+
timeout: 2s
27+
retries: 100
2528
ports:
2629
- "3306:3306"
2730
networks:
2831
- spalloc-mysql
2932
volumes:
3033
- spalloc-mysql-data:/var/lib/mysql
3134
- ./spalloc-mysql/init:/docker-entrypoint-initdb.d
35+
restart: always
3236

3337
spalloc:
3438
build:
@@ -45,10 +49,13 @@ services:
4549
condition: service_healthy
4650
env_file: spalloc.env
4751
environment:
52+
SPRING_DATASOURCE_USERNAME: spalloc
53+
SPRING_DATASOURCE_PASSWORD: spalloc
4854
SPRING_DATASOURCE_URL: jdbc:mysql://spalloc-mysql-container:3306/spalloc?autoReconnect=true&useSSL=false
4955
SPRING_HISTORICAL_DATASOURCE_URL: jdbc:mysql://spalloc-mysql-container:3306/spalloc_history?autoReconnect=true&useSSL=false
5056
volumes:
5157
- ./application.yml:/app/application.yml
58+
restart: always
5259

5360
networks:
5461
spalloc-mysql:

SpiNNaker-allocserv/spalloc.env.example

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,19 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
# Root password for the MYSQL instance
16-
MYSQL_ROOT_PASSWORD=
17-
18-
# Username for the spalloc database
19-
SPRING_DATASOURCE_USERNAME=
20-
21-
# Password for the spalloc database
22-
SPRING_DATASOURCE_PASSWORD=
23-
2415
# OpenID client id from EBRAINS
25-
EBRAINS_OPENID_CLIENT_ID=
16+
EBRAINS_OPENID_CLIENT_ID=spalloc
2617

2718
# OpenID client secret from EBRAINS
2819
EBRAINS_OPENID_CLIENT_SECRET=
2920

3021
# The host that people will use to access spalloc
22+
# This is the host name of this machine as seen from outside
3123
SPRING_SERVER_HOST=
3224

3325
# The API Key to access NMPI services (quota etc.)
3426
SPALLOC_NMPI_API_KEY=
3527

3628
# The IP address that the proxy should use to speak to real machines
29+
# This is the IP address of the local machine on the SpiNNaker network (e.g. 10.11.192.X)
3730
SPALLOC_PROXY_LOCAL_HOST=

mkpasswd.sh

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,5 @@ while true; do
2929
done
3030

3131
ENCPW=$(htpasswd -bnBC 10 "" $PASSWORD | tr -d ':\n' | sed 's/$2y/$2a/')
32-
echo $ENCPW
3332

34-
read -p "MySQL database: " MYSQLDB
35-
read -p "MySQL username: " MYSQLUSER
36-
read -p "MySQL password: " -s MYSQLPASS
37-
38-
mysql -D $MYSQLDB -u $MYSQLUSER -p$MYSQLPASS -e "INSERT INTO user_info(user_name, encrypted_password, trust_level) VALUES ('$USERNAME', '$ENCPW', $USERTRUST);"
33+
docker exec -it spalloc-mysql-container /usr/bin/mysql -D spalloc -u spalloc -pspalloc -e "INSERT INTO user_info(user_name, encrypted_password, trust_level) VALUES ('$USERNAME', '$ENCPW', $USERTRUST);"

0 commit comments

Comments
 (0)