feature/tech #3

Merged
jtorre merged 8 commits from feature/tech into develop 2023-06-03 14:42:00 -04:00
2 changed files with 7 additions and 3 deletions
Showing only changes of commit bf90a7cfb8 - Show all commits

View File

@ -47,7 +47,7 @@ RUN cmake \
-D MPI_BASE_DIR="/usr" \
-C /toolsrc/Xyce/cmake/trilinos/trilinos-config-MPI.cmake \
/toolsrc/Trilinos
RUN cmake --build . -j 8 -t install
RUN cmake --build . -j 40 -t install
# install Xyce
WORKDIR /toolsrc
@ -175,9 +175,12 @@ RUN mkdir /opt/cad/conf
ENV USER "bcli"
ENV USER_ID "1000"
ENV GROUP_ID "1000"
ENV MEMBERS ""
CMD exec /bin/bash -c "/usr/sbin/groupadd -g $GROUP_ID $USER; \
RUN echo "HELLO!?!?"
CMD exec /bin/bash -c "echo \"$MEMBERS\" | sed 's/ /\n/g' | xargs -n 2 /usr/sbin/groupadd -g; \
/usr/sbin/useradd -u $USER_ID -g $USER $USER; \
echo \"$MEMBERS\" | sed 's/ [0-9]\+ /,/g' | sed 's/[0-9]\+ //g' | xargs -I{} /usr/sbin/usermod -aG {} $USER; \
cp -r /template /home/$USER; \
chown -R $USER:$USER /home/$USER; \
trap : TERM INT; sleep infinity & wait"

View File

@ -1,6 +1,7 @@
bcli() {
if [ "$1" = "up" ]; then
docker run --rm -d -v $HOME:/host -v "/opt/tech:/opt/cad/conf" --name "bcli-$USER" -h "bcli-$USER" -e USER=$USER -e USER_ID=$(id -u) -e GROUP_ID=$(id -g) -e DISPLAY=$DISPLAY -v "/tmp/.X11-unix:/tmp/.X11-unix:rw" public.ecr.aws/l5h5o6z4/broccoli-cli:latest > /dev/null
export MEMBERS="$(groups | sed 's/ /\n/g' | xargs -I{} getent group {} | sed 's/\([^:]*\):[^:]*:\([^:]*\):.*/\2 \1/g')"
docker run --rm -d -v $HOME:/host -v "/opt/tech:/opt/cad/conf" --name "bcli-$USER" -h "bcli-$USER" -e USER=$USER -e USER_ID=$(id -u) -e GROUP_ID=$(id -g) -e DISPLAY=$DISPLAY -e MEMBERS="$MEMBERS" -v "/tmp/.X11-unix:/tmp/.X11-unix:rw" public.ecr.aws/l5h5o6z4/broccoli-cli:latest > /dev/null
#docker run --rm -d -v $HOME:/host -v "${BCLI_TECH:/opt/tech}:/opt/cad/conf" --name "bcli-$USER" -h "bcli-$USER" -e USER=$USER -e USER_ID=$(id -u) -e GROUP_ID=$(id -g) -e DISPLAY=$DISPLAY -v "/tmp/.X11-unix:/tmp/.X11-unix:rw" ${BCLI_IMAGE:-public.ecr.aws/l5h5o6z4/broccoli-cli:latest} > /dev/null
echo "bcli-$USER started"
elif [ "$1" = "down" ]; then