Commit b4c5a409 authored by Renato Figueiro Maia's avatar Renato Figueiro Maia
Browse files

Executar teste sem 'root' para desabilitar suporte a prioridades do Lanes.

[SOMA-7167][SOMA-6857]
parent e0680908
Pipeline #70719 passed with stages
in 4 minutes and 52 seconds
......@@ -79,24 +79,21 @@ lint:
test:
stage: test
image: repo.tecgraf.puc-rio.br:18082/node:14.15-stretch
image: repo.tecgraf.puc-rio.br:18089/soma/sga-test-ubuntu:20.04
cache:
paths:
- test/lua_runtime
- test/daemon/node_modules
script:
- bash install.sh --force --posix --pbs --slurm $(pwd)/test/lua_runtime
- for rockspec in *.rockspec; do
- test/lua_runtime/bin/luarocks --force remove ${rockspec%-*-*.rockspec}
- done
- cd test/daemon
- npm install
- npm run test
- cd ../..
- test/lua_runtime/bin/luarocks install --server=https://luarocks.org busted
- export PATH=".:${PATH}" # to use mockup commands like 'qsub' from PBS
- test/lua_runtime/bin/busted test/driver/posix.lua
- test/lua_runtime/bin/busted test/driver/pbs.lua
- cd ..
- lua_runtime/bin/luarocks install --server=https://luarocks.org busted
- useradd -M tester -p ''
- chown tester:tester $(pwd)
- su -c $(pwd)/test_drivers.sh tester
#-------------------------
# Docker Jobs
......@@ -113,18 +110,17 @@ test:
- export DOCKER_REGISTRY_IMAGE_DIND="${CI_REGISTRY_IMAGE}-dind"
- *docker_login
- docker pull $DOCKER_REGISTRY$CI_REGISTRY_IMAGE:$LAST || true
- docker pull $DOCKER_REGISTRY$DOCKER_REGISTRY_IMAGE_DIND:$LAST || true
- docker pull $DOCKER_REGISTRY$DOCKER_REGISTRY_IMAGE_DIND:$LAST || true
- |
docker build \
--tag $DOCKER_REGISTRY$CI_REGISTRY_IMAGE:$VERSION \
--tag $DOCKER_REGISTRY$CI_REGISTRY_IMAGE:$LAST \
-f Docker/Dockerfile .
- sed -r "s%^FROM .*%FROM $DOCKER_REGISTRY$CI_REGISTRY_IMAGE:$VERSION%" Docker/Dockerfile_withdocker > Docker/Dockerfile_dind
-f Docker/Dockerfile --target deploy .
- |
docker build \
--tag $DOCKER_REGISTRY$DOCKER_REGISTRY_IMAGE_DIND:$VERSION \
--tag $DOCKER_REGISTRY$DOCKER_REGISTRY_IMAGE_DIND:$LAST \
-f Docker/Dockerfile_dind .
-f Docker/Dockerfile --target deploy-with-docker .
- docker push $DOCKER_REGISTRY$CI_REGISTRY_IMAGE:$VERSION
- docker push $DOCKER_REGISTRY$CI_REGISTRY_IMAGE:$LAST
- docker push $DOCKER_REGISTRY$DOCKER_REGISTRY_IMAGE_DIND:$VERSION
......
......@@ -3,7 +3,7 @@ FROM repo.tecgraf.puc-rio.br:18089/soma/sga-build-ubuntu:20.04 as build
COPY . /tmp/sgarest-daemon
RUN cd /tmp/sgarest-daemon && ./install.sh --posix /sgad
FROM repo.tecgraf.puc-rio.br:18089/soma/sga-runtime-ubuntu:20.04
FROM repo.tecgraf.puc-rio.br:18089/soma/sga-runtime-ubuntu:20.04 as deploy
COPY --from=build /sgad /sgad
......@@ -24,3 +24,6 @@ ENV SGAD_LOGS_DIR $SGAD_HOME/data/logs
ENTRYPOINT ["./entrypoint.sh"]
CMD ["sgad.cfg"]
FROM deploy as deploy-with-docker
RUN apt-get update && apt-get install -y docker.io
FROM repo.tecgraf.puc-rio.br:18082/ubuntu:20.04 as system
RUN apt-get update
FROM system as build
RUN apt-get install -y \
curl \
g++ \
gcc \
libreadline-dev \
libssh-dev \
make \
unzip
FROM system as runtime
RUN apt-get install -y \
bc \
ksh \
libssl1.1 \
readline-common
FROM build as test
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC
RUN apt-get install -y \
bc \
ksh \
nodejs \
npm
FROM repo.tecgraf.puc-rio.br:18082/ubuntu:20.04
RUN apt-get update && apt-get install -y \
curl \
g++ \
gcc \
libreadline-dev \
libssh-dev \
make \
unzip
FROM repo.tecgraf.puc-rio.br:18082/ubuntu:20.04
RUN apt-get update && apt-get install -y \
bc \
ksh \
libssl1.1 \
readline-common
FROM SGA_IMAGE_NAME_TO_BE_REPLACED
RUN apt-get update && apt-get install -y docker.io
......@@ -4,8 +4,50 @@ The Docker image only works with the POSIX driver.
### Build
#### Base Images
The build of SGA Docker image makes use of other base images that provides the necessary dependencies to make the build of a new release faster.
Unless the system dependencies of SGA does not change,
there is no need to rebuild such the base images.
We use the follwing pre-built images:
- Build
```console
$ docker build -f Docker/Dockerfile_base --target build \
-t repo.tecgraf.puc-rio.br:18089/soma/sga-build-ubuntu:20.04 .
```
- Execution
```console
$ docker build -f Docker/Dockerfile_base --target runtime \
-t repo.tecgraf.puc-rio.br:18089/soma/sga-runtime-ubuntu:20.04 .
```
- Testing
```console
$ docker build -f Docker/Dockerfile_base --target test \
-t repo.tecgraf.puc-rio.br:18089/soma/sga-test-ubuntu:20.04 .
```
#### Release Images
We release two Docker images for the SGA Daemon:
- Standard
```console
$ docker build -f Docker/Dockerfile --target deploy \
-t soma/sga .
```
- With Docker Support (_Docker in Docker_)
```console
$ docker build -f Docker/Dockerfile -t soma/sga .
$ docker build -f Docker/Dockerfile --target deploy-with-docker \
-t soma/sga-dind .
```
### Run
......
......@@ -100,7 +100,7 @@ end
file:write('io.write(table.concat(arg, " "))\n')
file:close()
os.execute("chmod 700 "..cmdPath)
os.execute("chmod 755 "..cmdPath)
local expected = string.format(table.concat(spec.arguments, " "))
return function ()
......
#!/bin/bash
export PATH=".:${PATH}"
export LUA_PATH="../?.lua"
lua_runtime/bin/busted driver/posix.lua
lua_runtime/bin/busted driver/pbs.lua
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment