From faf54c0d13c5598911d7022f1ed0b0286b7c9a0a Mon Sep 17 00:00:00 2001 From: PProfizi <100710998+PProfizi@users.noreply.github.com> Date: Fri, 1 Jul 2022 16:30:21 +0200 Subject: [PATCH] Removing deprecated Docker files (#267) --- docker/Dockerfile | 11 -------- docker/IMAGE_NAME | 3 --- docker/README.md | 63 -------------------------------------------- docker/build.sh | 4 --- docker/env.sh | 5 ---- docker/push_image.sh | 4 --- docker/run_image.sh | 20 -------------- docker/run_tests.sh | 11 -------- 8 files changed, 121 deletions(-) delete mode 100644 docker/Dockerfile delete mode 100644 docker/IMAGE_NAME delete mode 100644 docker/README.md delete mode 100755 docker/build.sh delete mode 100644 docker/env.sh delete mode 100755 docker/push_image.sh delete mode 100755 docker/run_image.sh delete mode 100755 docker/run_tests.sh diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index 1ffd5d0f09..0000000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -# FROM centos:latest -FROM centos:7 - -MAINTAINER Alex Kaszynski "alexander.kaszynski@ansys.com" - -RUN mkdir -p /ansys_inc -COPY v212 /ansys_inc/v212 - -EXPOSE 50054 -WORKDIR /ansys_inc/v212/aisol/bin/linx64/ -CMD ["./Ans.Dpf.Grpc.sh"] \ No newline at end of file diff --git a/docker/IMAGE_NAME b/docker/IMAGE_NAME deleted file mode 100644 index 258edf422c..0000000000 --- a/docker/IMAGE_NAME +++ /dev/null @@ -1,3 +0,0 @@ -VERSION=v2021.2 -REPO=docker.pkg.github.com/pyansys/dpf-core -IMAGE=$REPO/dpf:$VERSION diff --git a/docker/README.md b/docker/README.md deleted file mode 100644 index 21956fe90f..0000000000 --- a/docker/README.md +++ /dev/null @@ -1,63 +0,0 @@ -### DPF Docker Image - -Run DPF within a container on any OS using `docker`. - ---- - -There are several situations in which it is advantageous to run DPF -in a containerized environment (e.g. Docker or singularity): - -- Run in a consistent environment regardless of the host OS. -- Portability and ease of install. -- Large scale cluster deployment using Kubernetes -- Genuine application isolation through containerization. - -### Usage - -This repository hosts several docker images which you can use to start -working with DPF immediately. Assuming you have docker installed, -you can get started by authorizing docker to access this repository -using a personal access token. Create a GH personal access token with -`packages read` permissions according to -[Creating a personal access token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) - -Save that token to a file with: -``` -echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX > GH_TOKEN.txt -``` - -This lets you send the token to docker without leaving the token value -in your history. Next, authorize docker to access this repository -with: - -``` -GH_USERNAME=myusername -cat GH_TOKEN.txt | docker login docker.pkg.github.com -u $GH_USERNAME --password-stdin -``` - -You can now launch DPF directly from docker with a short script or -directly from the command line. - -```bash -docker run -it --rm -v `pwd`:/dpf -p 50054:50054 docker.pkg.github.com/pyansys/dpf-core/dpf:v2021.1 -``` - -Note that this command shares the current directory to the `/dpf` -directory contained within the image. This is necessary as the DPF -binary within the image needs to access the files within the image -itself. - -Additionally, to avoid having to run `connect_to_server` at the start of every script, you can tell `ansys.dpf.core` to always attempt to connect to DPF running within the docker image by setting the following environment variables: - -``` -export DPF_START_SERVER=False -export DPF_PORT=50054 -``` - -``DPF_PORT`` is the port exposed from the DPF container and should match -the first value within the `-p 50054:50054` pair. - -``DPF_START_SERVER`` tells `ansys.dpf.core` not to start an instance and -rather look for the service running at DPF_IP and DPF_PORT. If -those environment variables are undefined, they default to 127.0.0.1 -and 50054 for DPF_IP and DPF_PORT respectively. diff --git a/docker/build.sh b/docker/build.sh deleted file mode 100755 index 6ac5d61055..0000000000 --- a/docker/build.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -source IMAGE_NAME -docker build -t $IMAGE . diff --git a/docker/env.sh b/docker/env.sh deleted file mode 100644 index d6ab447005..0000000000 --- a/docker/env.sh +++ /dev/null @@ -1,5 +0,0 @@ -# Setup the testing environment using docker -# run with: -# source env.sh -export DPF_START_SERVER=FALSE -export DPF_DOCKER=True diff --git a/docker/push_image.sh b/docker/push_image.sh deleted file mode 100755 index 2f3d4d1f59..0000000000 --- a/docker/push_image.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -source IMAGE_NAME -docker push $IMAGE diff --git a/docker/run_image.sh b/docker/run_image.sh deleted file mode 100755 index 45d5b389bb..0000000000 --- a/docker/run_image.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -# start the docker image locally and share the directory one level up - - -# Notes: - -# DPF_DOCKER tells "conftest.py" to resolve all the test files -# relative to the docker image's directory. Provided that you've -# mapped this source directory over (through -v `pwd`/../:/dpf below). - -# DPF_PORT is the port exposed from the DPF container. - -# DPF_START_SERVER tells `ansys.dpf.core` not to start an instance and -# rather look for the service running at DPF_IP and DPF_PORT. If -# those environment variables are undefined, they default to 127.0.0.1 -# and 50054 for DPF_IP and DPF_PORT respectively. - -source IMAGE_NAME -docker run -it --rm -v `pwd`/../:/dpf -v /tmp:/dpf/_cache -p 50054:50054 --name dpf $IMAGE diff --git a/docker/run_tests.sh b/docker/run_tests.sh deleted file mode 100755 index dc5cc6d459..0000000000 --- a/docker/run_tests.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -# Run unit tests from this directory after starting the docker image -parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) - - -export DPF_START_SERVER=False -export DPF_DOCKER=True -export DPF_PORT=50054 -pytest $parent_path/.. -vx -