To setup, there are a few directories with large files that need to be pulled from NOAA Google Drive and unzipped:
| Drive Link | Destination unZip Path | Notes |
|---|---|---|
| Technical_papers.zip | html/hdsc/Technical_papers/ | Must be unzipped |
| On-line_reports.zip | html/hdsc/On-line_reports/ | Must be unzipped |
| documents.zip | html/hdsc/ | Must be unzipped Includes: - html/hdsc/PF_documents/ - html/hdsc/PMP_documents/ - html/hdsc/PMP_related_studies/ - html/hdsc/Technical_memoranda/ - html/hdsc/Technical_reports/ |
| hi_review_response_draft2.doc | html/pfds/hi/ | |
| hi_station_maps_for_documentation.zip | html/pfds/hi | Do not decompress |
| orbreview_pdf_maps.tar.gz | html/pfds/images/orb_review/ | Do not decompress |
| na2_westus_100yr24hr.asc | html/support_grids/ |
All commands in this README.md must be run from a linux terminal.
sudo apt-get update -y
sudo apt-get install curl wget gnupg2 -y
curl -fsSL https://get.docker.com/ | sh
sudo usermod -aG docker $(whoami)
# Make sure to logout and log back in for the user permissions to take effect.
To confirm installation:
docker --version
- load the base image
docker load -i=ironbank-ubi8-latest-fips.tar
-
Add the custom SSL certificate files and update the ******.crt file in the
./ssldirectory../ssl/******.crt./ssl/******.key./ssl/******.crt
-
Run the following command to rebuild the image and container. The default configuration settings are for production.
docker compose up -d --build
- To test that the system is running pull up the index page: https://hdsc.nws.noaa.gov/pfds
- The
.envfiles will be used for development only. - Copy the
ENVfile to an.envfile.
cp ENV .env
- Using a standard text editor modify the ports and file-path locations as needed.
- Run the following command to build the image and container:
docker-compose up -d
- If there are any issues you can use the following commands to debug:
docker-compose logs
docker ps -a
docker-compose restart
docker-compose stop
- To access the container use the following:
- Access the shell
docker exec -it hdsc bash
- Feed a command to the container (example of restarting the webserver)
docker exec -it hdsc /usr/sbin/httpd -k restart
- To test this is working go to PFDS GIS view and click on the button
Click here to begin download. You should have a zip file available for download if PHP-FPM is enabled.
docker exec -it hdsc /usr/sbin/php-fpm
- Make sure to do a backup first!
- The following commands have been used
cd /hdsc_volumes/hdsc-website/ ;
git fetch --all -p ;
git rebase -v origin/master ;
docker compose up -d --force-recreate --build ;
-
The NightwatchJS library has been implemented to test frontend elements and functionality within the html pages. The tests have been setup to cover the local container
defaultas well as the test servertestand production serverproduction. -
To install the libary use the following command:
npm install
- To run the frontend tests with the local up and running container use the following command:
./runtests.sh default
- The previous to the last commit signature and datetime have been added to a hidden input element for visual verification. With the
last_commithidden element on the URI view/pfds/index.htmlwill show the previous commit in the repository. To access this element open a browser web developer panel and in the console enter the following command;
document.querySelector('#last_commit')
- Also note that on the view
/pfds/index.htmlat the bottom of the page the textPage last modified:will show the last update time for the repository.
- A possible error seen with loading
pfds_map_cont.htmlafter building on a UNIX machine;
[Fri Jul 12 00:45:53.224536 2024] [cgid:error] [pid 829:tid 140073295140608] [client ******:64050] AH01241: error spawning CGI child: exec of '/var/www/cgi-bin/new/cgi_readH5.py' failed (No such file or directory): /var/www/cgi-bin/new/cgi_readH5.py, referer: https://localhost:4433/pfds/pfds_map_cont.html?bkmrk=ks
[Fri Jul 12 00:45:53.225253 2024] [cgid:error] [pid 829:tid 140073295140608] [client ******:64050] End of script output before headers: cgi_readH5.py, referer: https://localhost:4433/pfds/pfds_map_cont.html?bkmrk=ks
- To fix this it might require running dos2unix on all Python files using the following command to fix the error. Note this should also be done with the four Python-posing-as-CSV files;
find . -name '*.py' -type f -exec dos2unix {} \;
find . -name '*.csv' -type f -exec dos2unix {} \;