-
Notifications
You must be signed in to change notification settings - Fork 0
/
prepare.sh
executable file
·47 lines (39 loc) · 1.46 KB
/
prepare.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
#
# Authors:
# - Paul Nilsson, [email protected], 2021
# Note: this file must be executable
set -x
# We start by adding extra apt packages, since pip modules may required library
#if [ "$EXTRA_APT_PACKAGES" ]; then
# echo "EXTRA_APT_PACKAGES environment variable found. Installing."
# apt update -y
# apt install -y $EXTRA_APT_PACKAGES
#fi
if [ -e "/opt/app/environment.yml" ]; then
echo "environment.yml found. Installing packages"
/opt/conda/bin/conda env update -f /opt/app/environment.yml
conda init bash
activate myenv
else
echo "no environment.yml"
fi
#if [ "$EXTRA_CONDA_PACKAGES" ]; then
# echo "EXTRA_CONDA_PACKAGES environment variable found. Installing."
# /opt/conda/bin/conda install -y $EXTRA_CONDA_PACKAGES
#fi
#if [ "$EXTRA_PIP_PACKAGES" ]; then
# echo "EXTRA_PIP_PACKAGES environment variable found. Installing".
# /opt/conda/bin/pip install $EXTRA_PIP_PACKAGES
#fi
# Run extra commands
#exec "$@"
# env var DASK_SCHEDULER_IP should be set by the dask-worker-deployment.yaml file launched by the kubectl command
# e.g. DASK_SCHEDULER_IP=tcp://10.8.1.6:8786
echo "starting dask worker"
dask-worker $DASK_SCHEDULER_IP --local-directory $DASK_SHARED_FILESYSTEM_PATH
echo "finished dask worker"