-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathentrypoint-opensuse.sh
More file actions
executable file
·87 lines (77 loc) · 2.61 KB
/
Copy pathentrypoint-opensuse.sh
File metadata and controls
executable file
·87 lines (77 loc) · 2.61 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/bash
#___INFO__MARK_BEGIN_NEW__
###########################################################################
#
# Copyright 2024 HPC-Gridware GmbH
#
# 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
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
###########################################################################
#___INFO__MARK_END_NEW__
# Entrypoint script for openSUSE-based OCS container
# Check if OCS is installed, if not, install it
if [ ! -f "${SGE_ROOT}/default/common/settings.sh" ]; then
echo "OCS not installed. Installing OCS 9.0.7..."
cd /opt/helpers
OCS_VERSION="9.0.7" ./ocs.sh --accept-license
if [ $? -ne 0 ]; then
echo "Warning: OCS installation failed, continuing with basic setup..."
fi
fi
# Source OCS environment if available
if [ -f "${SGE_ROOT}/default/common/settings.sh" ]; then
echo "Sourcing OCS environment..."
source ${SGE_ROOT}/default/common/settings.sh
else
echo "OCS environment not found, using default environment variables"
echo "SGE_ROOT=${SGE_ROOT}"
echo "SGE_QMASTER_PORT=${SGE_QMASTER_PORT}"
echo "SGE_EXECD_PORT=${SGE_EXECD_PORT}"
fi
# Check if OCS binaries are available
if command -v qconf >/dev/null 2>&1; then
echo "OCS commands available:"
echo " qconf: $(which qconf)"
echo " qsub: $(which qsub)"
echo " qstat: $(which qstat)"
else
echo "Warning: OCS commands not found in PATH"
echo "Current PATH: $PATH"
fi
# Start OCS services if not already running
echo "Checking OCS services..."
if ! pgrep -f sge_qmaster >/dev/null 2>&1; then
echo "Starting OCS qmaster..."
${SGE_ROOT}/bin/lx-amd64/sge_qmaster &
fi
if ! pgrep -f sge_execd >/dev/null 2>&1; then
echo "Starting OCS execd..."
${SGE_ROOT}/bin/lx-amd64/sge_execd &
fi
# Wait a moment for services to start
sleep 3
# Display cluster status
echo "Cluster status:"
if command -v qhost >/dev/null 2>&1; then
qhost 2>/dev/null || echo "qhost not available or cluster not ready"
else
echo "qhost command not available"
fi
# Execute the command passed to the container
if [ $# -gt 0 ]; then
echo "Executing: $@"
exec "$@"
else
echo "Starting interactive shell..."
exec /bin/bash
fi