From abbdeefef6f7a2cd8ecb536830ed44688d965a79 Mon Sep 17 00:00:00 2001 From: Daniel Garcia Briseno <94071409+dgarciabriseno@users.noreply.github.com> Date: Tue, 28 May 2024 13:06:51 -0400 Subject: [PATCH] Add coordinator image to compose (#48) * Add coordinator image to compose * Update ffmpeg * Fix movie builder permissions * Print container logs * fix movie dockerfile typo * remove cli, update containers * Update CI * Allow setting hostnames from environment * Add .env to gitignore * Setup .env in workflow * Enable mod rewrite in web * Update apache ver * Remove stale test * Delete removed test * Fix typo * update readme --- .env.example | 4 + .github/workflows/build-check.yml | 12 +- .github/workflows/push-to-hub.yml | 3 + .gitignore | 3 +- README.md | 6 + compose.yaml | 39 ++-- compose/Config.ini | 176 ------------------- compose/Private.php | 67 ------- compose/dockerfiles/api_server.Dockerfile | 54 +++--- compose/dockerfiles/cli.Dockerfile | 37 ---- compose/dockerfiles/db.Dockerfile | 21 +++ compose/dockerfiles/movie_builder.Dockerfile | 27 +-- compose/dockerfiles/webserver.Dockerfile | 5 +- compose/scripts/api_config.sh | 4 +- compose/scripts/api_startup.sh | 3 - compose/scripts/cli_start.sh | 18 -- compose/scripts/headless_setup.sh | 4 +- compose/scripts/install_composer.sh | 18 -- compose/scripts/webserver_dev_mode.sh | 4 +- tests/test_hgs2hpc_restarts.sh | 32 ---- 20 files changed, 102 insertions(+), 435 deletions(-) create mode 100644 .env.example delete mode 100644 compose/Config.ini delete mode 100644 compose/Private.php delete mode 100644 compose/dockerfiles/cli.Dockerfile create mode 100644 compose/dockerfiles/db.Dockerfile delete mode 100755 compose/scripts/cli_start.sh delete mode 100644 compose/scripts/install_composer.sh delete mode 100644 tests/test_hgs2hpc_restarts.sh diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..3582715 --- /dev/null +++ b/.env.example @@ -0,0 +1,4 @@ +# Hostname to use in helioviewer configuration +HV_HOST=localhost +API_PORT=8081 +CLIENT_PORT=8080 \ No newline at end of file diff --git a/.github/workflows/build-check.yml b/.github/workflows/build-check.yml index fc3ce57..ebca3f4 100644 --- a/.github/workflows/build-check.yml +++ b/.github/workflows/build-check.yml @@ -13,6 +13,9 @@ jobs: with: submodules: 'recursive' + - name: Setup environment + run: mv .env.example .env + - name: Build containers run: docker compose build @@ -34,8 +37,15 @@ jobs: - name: Check that containers start and become healthy run: docker compose up -d --wait + - name: Print logs + if: always() + run: | + docker logs helioviewer-api-1 + docker logs helioviewer-web-1 + docker logs helioviewer-database-1 + docker logs helioviewer-movies-1 + - name: Test Helioviewer environment run: | - bash tests/test_hgs2hpc_restarts.sh bash tests/test_make_movie.sh bash tests/test_aia_images.sh diff --git a/.github/workflows/push-to-hub.yml b/.github/workflows/push-to-hub.yml index 7328f17..431926d 100644 --- a/.github/workflows/push-to-hub.yml +++ b/.github/workflows/push-to-hub.yml @@ -14,6 +14,9 @@ jobs: with: submodules: 'recursive' + - name: Setup environment + run: mv .env.example .env + - name: Build containers run: docker compose build diff --git a/.gitignore b/.gitignore index 4d44300..3c6d025 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .DS_Store .devcontainer test_setup_done -secrets \ No newline at end of file +secrets +.env \ No newline at end of file diff --git a/README.md b/README.md index 41b3bd9..9965da2 100644 --- a/README.md +++ b/README.md @@ -9,12 +9,18 @@ Once installed clone this repo and run docker compose: ```bash git clone --recurse-submodules https://github.com/Helioviewer-Project/helioviewer.org-docker.git cd helioviewer.org-docker +mv .env.example .env docker compose up -d --wait ``` It may take a while for the containers to be built and the application to start up. Once the output from docker settles down, check that it's running by going to http://localhost:8080/ +## Configuration + +Configuration is made via the `.env` file. By default this is set to +bind and run everything on localhost. You can change this by editing `.env` + # Testing For contributors to this environment, you can write tests to verify that the Helioviewer environment is working. The `tests` folder contains scripts that diff --git a/compose.yaml b/compose.yaml index 23194cf..e122ed1 100644 --- a/compose.yaml +++ b/compose.yaml @@ -1,7 +1,9 @@ name: helioviewer services: database: - image: mariadb + image: dgarciabriseno/helioviewer-db-dev + build: + dockerfile: ./compose/dockerfiles/db.Dockerfile environment: MARIADB_ROOT_PASSWORD: helioviewer ports: @@ -12,20 +14,28 @@ services: interval: 5s timeout: 5s retries: 3 + volumes: + - jp2_volume:/tmp/jp2 redis: image: redis ports: - 6379:6379 restart: on-failure + # Supporting python api for the helioviewer api + coordinator: + image: dgarciabriseno/hv-coordinator:0.1.0 api: + env_file: + - .env image: dgarciabriseno/helioviewer-api-dev build: dockerfile: ./compose/dockerfiles/api_server.Dockerfile ports: - - 8081:80 + - ${API_PORT}:80 depends_on: - database - redis + - coordinator restart: on-failure platform: linux/amd64 healthcheck: @@ -45,11 +55,13 @@ services: target: /var/www/api.helioviewer.org - api_logs:/var/www/api.helioviewer.org/log web: + env_file: + - .env image: dgarciabriseno/helioviewer-web-dev build: dockerfile: ./compose/dockerfiles/webserver.Dockerfile ports: - - 8080:80 + - ${CLIENT_PORT}:80 depends_on: - api restart: on-failure @@ -77,27 +89,6 @@ services: target: /var/www/api.helioviewer.org - jp2_volume:/tmp/jp2 - cache:/var/www/helioviewer.org/cache - cli: - image: dgarciabriseno/helioviewer-cli-dev - build: - dockerfile: ./compose/dockerfiles/cli.Dockerfile - depends_on: - database: - condition: service_healthy - platform: linux/x86_64 - healthcheck: - # Check every 10 seconds, wait up to 2 minutes - test: ["CMD", "ls", "/tmp/jp2/LASCO-C2/2023/12/01/white-light/"] - interval: 10s - timeout: 1s - retries: 12 - volumes: - - type: volume - source: jp2_volume - target: /tmp/jp2 - - type: bind - source: ./api - target: /home/admin/api volumes: jp2_volume: diff --git a/compose/Config.ini b/compose/Config.ini deleted file mode 100644 index 106e1ef..0000000 --- a/compose/Config.ini +++ /dev/null @@ -1,176 +0,0 @@ -; Note: These settings are defined for the pre-built container environment, -; this configuration may not be suitable for production. - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Helioviewer.org Example Configuration ; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; -; This file contains basic configuration parameters used to control -; Helioviewer.org's behavior. Before Helioviewer.org can be used, this file -; must be copied or renamed to Config.ini and adjusted to reflect your system -; settings. Many of the parameters are described below. For a more detailed -; description of the entire installation process, see the installation -; documentation located on the Helioviewer Wiki: -; -; http://wiki.helioviewer.org/wiki/Installing_Helioviewer.org -; -; Questions/Comments? -; contact@helioviewer.org -; -[version] -last_update = 2021/11/18 -build_num = 821 - -[filepaths] -; The root directory where of your Helioviewer.org installation. This must be -; somewhere that Apache allows access to. -root_dir = /home/helioviewer/api.helioviewer.org/docroot - -; Directory where cache files will be written. Must be writable by Apache. -; You may want to set up a cron job to periodically cull old or infrequently -; accessed caches. -cache_dir = /home/helioviewer/helioviewer.org/cache - -; The root directory of your JPEG 2000 archive, if one is available. -jp2_dir = /tmp/jp2 - -[urls] -; The URL that corresponds with the root_dir specified above. -web_root_url = http://localhost:8081 - -; The URL that corresponds with the jp2_dir specified above. -jp2_root_url = http://localhost:8081 - -; The root URL to your JPIP server if one is available. -jpip_root_url = jpip://localhost:8090 - -; The root URL to the Helioviewer client application -client_url = http://helioviewer.org - -; CORS -;acao_url[] = '' -acam = 'GET' - -[executables] -; Location of the kdu_merge binary to be used during JPX image generation. -kdu_merge_bin = /usr/local/bin/kdu_merge - -; Location of the kdu_merge binary to be used during tile generation. -kdu_expand = /usr/local/bin/kdu_expand - -[jhelioviewer] -; The maximum frames allowed for a JPX image request. Requests which would go -; over this limit are automatically adjusted (sub-sampled) and a JPX file with -; this many or fewer frames is generated instead. -; Note that due to limitations relating to the length allowed for kdu_merge -; command-line arguments, values which are very large may not always work. -; Future versions of Helioviewer may include a work-around to this limitation, -; however, the limit currently allowed should probably be sufficient for most -; cases. -max_jpx_frames = 1000 - -[events] -; Use MySQL database to store events (true = yes; false = no) -db_events = true -; Auth password to import events. Must be included as an auth url parameter when calling importEvents. -; For example /?action=importEvents&period=1D&auth=1337 -; Leave blank for no password, otherwise choose a long and sufficiently random string -import_events_auth = "" - -[movie_params] -; FFmpeg location -ffmpeg = ffmpeg - -; x264 FFpreset to use during encoding of high-quality and regular-quality -; H.264 movies. Note that this is only applicable to older versions of x264: -; newer versions of x264 have been simplified and no longer use the preset -; files. -x264_preset = "fast" -x264_hq_preset = "ultrafast" - -; The maximum number of frames to allow for static movie (ogv, mp4, avi) -; generation. -max_movie_frames = 300 -; The maximum number of rows from the database that can be processed to create a movie. -; This is to preserve memory usage, since each row represents a frame, and this -; will be reduced to the above number of frames. As long as this is greater than -; max_movie_frames, this should have no material impact on generating movies. -max_row_limit = 15000 - -; Maximum number of threads FFmpeg is allowed to use during movie generation. -; No all video codecs have support for multi-threaded encoding, but two of -; the libraries used by Helioviewer.org (libx264 and libvpx) do support -; parallelization. Note that while setting this value to '0' will cause -; libx264 to use all available CPU's, this does not work for libvpx and -; should therefor be avoided. -ffmpeg_max_threads = 8 - -; Movie generation queue -movie_queue = "api_movie" - -[statistics] -; Whether basic usage statistics should be collected by Helioviewer.org. -; Currently the information collected is very basic and does not include -; information about the specifics of the query, but rather the type of -; query and when the query was made. -enable_statistics_collection = true - -[extra] -; An optional Google Analytics Web Property ID. If set, the Google Analytics -; code will be included on the main page using the specified ID. -; See https://www.google.com/analytics for more information. -google_analytics_id = "" - -[boundaries] -; The date representing the oldest data that is available on helioviewer. -; This is used to ignore any requests for times that come in below this date. -; Helioviewer may also use this as a way to check that a given date is valid. -minimum_date = '1990-01-01' - -[news] -; RSS/Atom News feed to display headlines from -news_feed_url = http://blog.helioviewer.org/feed/ - -[contact] -; Contact email address -contact_email = HelioViewerDevelopment@nasa.onmicrosoft.com - -; Image that appears at the top of the API documentation -api_logo = resources/images/about.png - -[debug] -; Disables caching of image tiles -disable_cache = false - -[status] -; Directory where the backfill logs are stored to be displayed on the status page -; These should be updated on a running server to a less temporary space if not -; just for testing. -SDO_weekly_log = /tmp/sdo-backfill.log -SDO_monthly_log = /tmp/sdo-monthly.log -SWAP_weekly_log = /tmp/rob-backfill.log -SWAP_monthly_log = /tmp/rob-monthly.log -SOHO_weekly_log = /tmp/soho-backfill.log -SOHO_monthly_log = /tmp/soho-monthly.log -STEREO_weekly_log = /tmp/stereo-backfill.log -STEREO_monthly_log = /tmp/stereo-monthly.log - -[rate-limit] -; Whether or not rate limiting should be enabled and enforced -; Whether or not rate limiting should be enabled and enforced -enforce_rate_limit = false -; Maximum number of requests (per minute) that a client can make before being rate limited -rate_limit_maximum_requests = 3000 -; Prefix for the key stored in redis db. All keys will be structured as "identifier/interval" -rate_limit_prefix = "limit" -; Prefix for rate limit exceeded logging keys -; Contains date so the key cannot contain : because of h:m:s iso date format -rate_exceeded_prefix = "exceeded" - -[redis-stats] -redis_stats_prefix = "stat" - -[proxy] -http_proxy = '' -https_proxy = '' -http_export = '' diff --git a/compose/Private.php b/compose/Private.php deleted file mode 100644 index 93a52dc..0000000 --- a/compose/Private.php +++ /dev/null @@ -1,67 +0,0 @@ - 'name of command' - * )) - * - * TODO: - * PHP 7 support arrays inside constants. - */ -define("TERMINAL_COMMANDS", serialize(array())); -?> diff --git a/compose/dockerfiles/api_server.Dockerfile b/compose/dockerfiles/api_server.Dockerfile index 8157d03..37c9f45 100644 --- a/compose/dockerfiles/api_server.Dockerfile +++ b/compose/dockerfiles/api_server.Dockerfile @@ -5,41 +5,37 @@ FROM php:8.0.30-apache # Setup apache to serve from the docroot folder. # Install composer for php dependencies ENV APACHE_DOCUMENT_ROOT /var/www/api.helioviewer.org/docroot -COPY ./compose/scripts/install_composer.sh /root COPY api/install/kakadu/Kakadu_v6_4_1-00781N_Linux-64-bit-Compiled.tar.gz kdu.tar.gz -RUN apt update \ - && apt install -y unzip libpng-dev libjpeg-dev libfreetype-dev python3-dev libmariadb-dev python3-venv \ - && curl -s --output imagemagick.zip -X GET https://codeload.github.com/ImageMagick/ImageMagick6/zip/refs/tags/6.9.12-70 \ - && unzip imagemagick.zip \ - && rm imagemagick.zip \ - && cd ImageMagick6-6.9.12-70 \ - && ./configure && make -j$(nproc) && make install \ - && cd .. \ - && rm -rf ImageMagick6-6.9.12-70 \ - && docker-php-ext-configure mysqli \ - && docker-php-ext-configure sockets \ - && docker-php-ext-configure bcmath \ - && docker-php-ext-install -j$(nproc) mysqli sockets bcmath \ - && pecl install redis \ - && pecl install xdebug \ - && pecl install imagick \ - && docker-php-ext-enable redis xdebug imagick \ - && curl -X GET "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz" --output ffmpeg.tar.xz \ - && tar xf ffmpeg.tar.xz \ - && mv ffmpeg-6.1-amd64-static/ffmpeg /usr/local/bin \ - && rm -rf ffmpeg.tar.xz ffmpeg-6.1-amd64-static \ - && tar xzf kdu.tar.gz \ - && mv bin/* /usr/local/bin \ - && mv lib/* /usr/lib \ - && rm -r bin lib \ - && sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf \ - && sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf \ - && bash /root/install_composer.sh +RUN < /usr/local/etc/php/conf.d/99-imagick.ini -printf "\n" | pecl install redis -echo "extension=redis.so" > /usr/local/etc/php/conf.d/99-redis.ini +apt update +apt install -y ruby tcsh gem install resque docker-php-ext-configure pcntl docker-php-ext-install -j $(nproc) pcntl -docker-php-ext-configure bcmath -docker-php-ext-install -j $(nproc) bcmath -docker-php-ext-configure mysqli -docker-php-ext-install -j $(nproc) mysqli mv /usr/local/bin/resque /usr/local/bin/_resque echo "_resque -r redis:6379 \$@" > /usr/local/bin/resque chmod +x /usr/local/bin/resque -useradd movies -mkdir -p /var/www/helioviewer.org/cache/movies -chown -R movies:movies /var/www/helioviewer.org/cache/movies END_OF_COMMANDS -USER movies WORKDIR /var/www/api.helioviewer.org/scripts -CMD REDIS_BACKEND=redis:6379 tcsh movie_queue.tcsh && tail -F /dev/null \ No newline at end of file +ENTRYPOINT ["/bin/bash", "-c"] +ENV REDIS_BACKEND=redis:6379 +CMD ["tcsh movie_queue.tcsh && tail -F /dev/null"] \ No newline at end of file diff --git a/compose/dockerfiles/webserver.Dockerfile b/compose/dockerfiles/webserver.Dockerfile index 3d94ce8..efe3386 100644 --- a/compose/dockerfiles/webserver.Dockerfile +++ b/compose/dockerfiles/webserver.Dockerfile @@ -1,9 +1,10 @@ -FROM php:8.0.27-apache +FROM php:8.0.30-apache RUN docker-php-ext-configure mysqli && docker-php-ext-install -j$(nproc) mysqli \ && pecl install redis \ && docker-php-ext-enable redis \ && apt update \ - && apt install -y ant python3 inotify-tools + && apt install -y ant python3 inotify-tools \ + && a2enmod rewrite COPY ./compose/scripts/webserver_dev_mode.sh /root diff --git a/compose/scripts/api_config.sh b/compose/scripts/api_config.sh index f2dad95..83de001 100644 --- a/compose/scripts/api_config.sh +++ b/compose/scripts/api_config.sh @@ -9,8 +9,8 @@ sed -i "s|/var/www/api.helioviewer.org/docroot/cache|/var/www/helioviewer.org/ca sed -i "s|/var/www/api.helioviewer.org/docroot/jp2|/tmp/jp2|" $tmpfile mv $tmpfile $configfile -echo "acao_url[] = http://localhost:8080" >> ${SETTINGS_DIR}/Config.ini -echo "acao_url[] = http://127.0.0.1:8080" >> ${SETTINGS_DIR}/Config.ini +echo "acao_url[] = http://$HV_HOST:$CLIENT_PORT" >> ${SETTINGS_DIR}/Config.ini +echo "acao_url[] = http://127.0.0.1:$CLIENT_PORT" >> ${SETTINGS_DIR}/Config.ini tmpfile=/tmp/config.ini configfile=${SETTINGS_DIR}/Private.php diff --git a/compose/scripts/api_startup.sh b/compose/scripts/api_startup.sh index 0211a57..7f4b588 100644 --- a/compose/scripts/api_startup.sh +++ b/compose/scripts/api_startup.sh @@ -7,9 +7,6 @@ mkdir -p /var/www/helioviewer.org/cache/tiles chmod 777 /var/www/helioviewer.org/cache/tiles COMPOSER_HOME=/root composer install -# Delete the stale socket file if it exists -rm -f /tmp/hgs2hpc.sock -/var/www/api.helioviewer.org/vendor/bin/start_hgs2hpc pushd /var/www/api.helioviewer.org/install python3 -m venv venv diff --git a/compose/scripts/cli_start.sh b/compose/scripts/cli_start.sh deleted file mode 100755 index 8619119..0000000 --- a/compose/scripts/cli_start.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -source venv/bin/activate -cp /home/admin/*.jp2 /tmp/jp2 -./headless_setup.sh - -SETTINGS_DIR=/home/admin/api/install/settings -TMPFILE=/tmp/settings.cfg -sed "s|dbhost = localhost|dbhost = database|" ${SETTINGS_DIR}/settings.example.cfg > $TMPFILE -sed -i "s|/mnt/data/hvpull|/tmp|" $TMPFILE -sed -i "s|/mnt/data/jp2|/tmp/jp2|" $TMPFILE -sed "s|server = localhost|server=|" $TMPFILE > ${SETTINGS_DIR}/settings.cfg - -# Download some test data -set -e -cd /home/admin/api/install -python downloader.py -d hv_soho -s "2023-12-01 00:00:00" -e "2023-12-01 01:00:00" - -tail -f /dev/null diff --git a/compose/scripts/headless_setup.sh b/compose/scripts/headless_setup.sh index 58acd2c..ef158ef 100755 --- a/compose/scripts/headless_setup.sh +++ b/compose/scripts/headless_setup.sh @@ -1,14 +1,14 @@ #!/usr/bin/expect -f set timeout 5 -spawn python3 api/install/install.py +spawn python3 install.py expect "Location" { send "/tmp/jp2\r" } expect "Choice" { send "1\r" } expect "Database" { send "\r" } expect "Username" { send "\r" } expect "Password" { send "\r" } -expect "Database" { send "database\r" } +expect "Database" { send "\r" } expect "Choice" { send "1\r" } expect "Username" { send "root\r" } expect "Password" { send "helioviewer\r" } diff --git a/compose/scripts/install_composer.sh b/compose/scripts/install_composer.sh deleted file mode 100644 index ba30534..0000000 --- a/compose/scripts/install_composer.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')" -php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" -ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")" - -if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ] -then - >&2 echo 'ERROR: Invalid installer checksum' - rm composer-setup.php - exit 1 -fi - -php composer-setup.php --quiet -RESULT=$? -rm composer-setup.php -mv composer.phar /usr/bin/composer -exit $RESULT diff --git a/compose/scripts/webserver_dev_mode.sh b/compose/scripts/webserver_dev_mode.sh index 74a0e2e..cee36ed 100644 --- a/compose/scripts/webserver_dev_mode.sh +++ b/compose/scripts/webserver_dev_mode.sh @@ -7,8 +7,8 @@ set -e # then write the final edited config back to the config file. configfile=/var/www/html/resources/js/Utility/Config.js tmpconfig=/tmp/tmpconfig -sed "s|https://api.helioviewer.org|http://localhost:8081|" $configfile > $tmpconfig -sed "s|https://helioviewer.org|http://localhost:8080|" $tmpconfig > $configfile +sed "s|https://api.helioviewer.org|http://$HV_HOST:$API_PORT|" $configfile > $tmpconfig +sed "s|https://helioviewer.org|http://$HV_HOST:$CLIENT_PORT|" $tmpconfig > $configfile rm $tmpconfig cd /root diff --git a/tests/test_hgs2hpc_restarts.sh b/tests/test_hgs2hpc_restarts.sh deleted file mode 100644 index a01fab2..0000000 --- a/tests/test_hgs2hpc_restarts.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -set -e - -# Tests issue https://github.com/Helioviewer-Project/helioviewer.org-docker/issues/42 -# When restarting the API Server, the hgs2hpc process does not restart -# Pre-requisites -# - Contains have already been started with `docker compose up` -# Test steps -# 1. Verify that the hgs2hpc service is running -# 2. Stop the API container -# 3. Restart the API container -# 4. Verify that the hgs2hpc service is running - -# 1. Verify hgs2hpc service is running -# pgrep returns exit code 1 if the process is not found, which will make this -# test fail -echo "Checking for hgs2hpc process" -pid=$(docker exec helioviewer-api-1 pgrep -f hgs2hpc) -echo "Found hgs2hpc process with PID $pid" - -# 2. Stop the API container -echo "Stopping the api container" -docker container stop helioviewer-api-1 - -# 3. Restart the API container and wait for it to be ready -echo "Restarting the api container via docker compose" -docker compose up -d --wait - -# 4. Verify that the hgs2hpc service is running -echo "Checking that the hgs2hpc process is running" -pid=$(docker exec helioviewer-api-1 pgrep -f hgs2hpc) -echo "Found hgs2hpc process on pid $pid" \ No newline at end of file