mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
add workflow for centos 8
This commit is contained in:
126
.github/workflows/vagrant-scripts.yml
vendored
126
.github/workflows/vagrant-scripts.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: Install scripts
|
name: Install and Import
|
||||||
|
|
||||||
on: [ push, pull_request ]
|
on: [ push, pull_request ]
|
||||||
|
|
||||||
@@ -11,25 +11,19 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
|
|
||||||
- name: Get Date
|
|
||||||
id: get-date
|
|
||||||
run: |
|
|
||||||
echo "::set-output name=date::$(/bin/date -u "+%Y%W")"
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
data/country_grid.sql.gz
|
data/country_osm_grid.sql.gz
|
||||||
key: nominatim-country-data-${{ steps.get-date.outputs.date }}
|
key: nominatim-country-data-1
|
||||||
|
|
||||||
- name: Package tarball
|
- name: Package tarball
|
||||||
run: |
|
run: |
|
||||||
if [ ! -f data/country_grid.sql.gz ]; then
|
if [ ! -f data/country_osm_grid.sql.gz ]; then
|
||||||
wget --no-verbose -O data/country_grid.sql.gz https://www.nominatim.org/data/country_grid.sql.gz
|
wget --no-verbose -O data/country_osm_grid.sql.gz https://www.nominatim.org/data/country_grid.sql.gz
|
||||||
fi
|
fi
|
||||||
cd ..
|
cd ..
|
||||||
tar cjf nominatim-src.tar.bz2 Nominatim
|
tar czf nominatim-src.tar.bz2 Nominatim
|
||||||
mv nominatim-src.tar.bz2 Nominatim
|
mv nominatim-src.tar.bz2 Nominatim
|
||||||
|
|
||||||
- name: 'Upload Artifact'
|
- name: 'Upload Artifact'
|
||||||
@@ -39,8 +33,8 @@ jobs:
|
|||||||
path: nominatim-src.tar.bz2
|
path: nominatim-src.tar.bz2
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
|
|
||||||
ubuntu:
|
ubuntu:
|
||||||
|
if: false
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: create-archive
|
needs: create-archive
|
||||||
|
|
||||||
@@ -100,6 +94,7 @@ jobs:
|
|||||||
. vagrant.sh
|
. vagrant.sh
|
||||||
working-directory: /home/nominatim
|
working-directory: /home/nominatim
|
||||||
|
|
||||||
|
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
@@ -150,3 +145,108 @@ jobs:
|
|||||||
- name: Check reverse import
|
- name: Check reverse import
|
||||||
run: nominatim admin --check-database
|
run: nominatim admin --check-database
|
||||||
working-directory: data-env-reverse
|
working-directory: data-env-reverse
|
||||||
|
|
||||||
|
|
||||||
|
centos:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: create-archive
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
centos: [8]
|
||||||
|
|
||||||
|
container:
|
||||||
|
image: centos:${{ matrix.centos }}
|
||||||
|
env:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: sudo -Hu nominatim bash --noprofile --norc -eo pipefail {0}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Prepare container
|
||||||
|
run: |
|
||||||
|
dnf update -y
|
||||||
|
dnf install -y sudo
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Setup import user
|
||||||
|
run: |
|
||||||
|
useradd -m nominatim
|
||||||
|
echo 'nominatim ALL=(ALL:ALL) NOPASSWD: ALL' > /etc/sudoers.d/nominiatim
|
||||||
|
echo "/home/nominatim/Nominatim/vagrant/Install-on-Centos-$CENTOS.sh no" > /home/nominatim/vagrant.sh
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
CENTOS: ${{ matrix.centos }}
|
||||||
|
|
||||||
|
- uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
name: full-source
|
||||||
|
path: /home/nominatim
|
||||||
|
|
||||||
|
- name: Get Date
|
||||||
|
id: get-date
|
||||||
|
run: |
|
||||||
|
echo "::set-output name=date::$(/bin/date -u "+%Y%W")"
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Install Nominatim
|
||||||
|
run: |
|
||||||
|
export USERNAME=nominatim
|
||||||
|
export USERHOME=/home/nominatim
|
||||||
|
export NOSYSTEMD=yes
|
||||||
|
export HAVE_SELINUX=no
|
||||||
|
tar xf nominatim-src.tar.bz2
|
||||||
|
ls -al /home/nominatim/Nominatim/data
|
||||||
|
. vagrant.sh
|
||||||
|
working-directory: /home/nominatim
|
||||||
|
|
||||||
|
- name: Prepare import environment
|
||||||
|
run: |
|
||||||
|
mv /home/nominatim/Nominatim/test/testdb/apidb-test-data.pbf test.pbf
|
||||||
|
rm -rf /home/nominatim/Nominatim
|
||||||
|
mkdir data-env data-env-reverse
|
||||||
|
chown nominatim. data-env data-env-reverse
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Prepare import environment (CentOS)
|
||||||
|
run: |
|
||||||
|
sudo ln -s /usr/local/bin/nominatim /usr/bin/nominatim
|
||||||
|
echo NOMINATIM_DATABASE_WEBUSER="apache" > data-env/.env
|
||||||
|
cp data-env/.env data-env-reverse/.env
|
||||||
|
|
||||||
|
- name: Import
|
||||||
|
run: nominatim import --osm-file ../test.pbf
|
||||||
|
working-directory: data-env
|
||||||
|
|
||||||
|
- name: Import special phrases
|
||||||
|
run: nominatim special-phrases --import-from-wiki
|
||||||
|
working-directory: data-env
|
||||||
|
|
||||||
|
- name: Check full import
|
||||||
|
run: nominatim admin --check-database
|
||||||
|
working-directory: data-env
|
||||||
|
|
||||||
|
- name: Warm up database
|
||||||
|
run: nominatim admin --warm
|
||||||
|
working-directory: data-env
|
||||||
|
|
||||||
|
- name: Run update
|
||||||
|
run: |
|
||||||
|
pip3 install --user osmium
|
||||||
|
nominatim replication --init
|
||||||
|
NOMINATIM_REPLICATION_MAX_DIFF=1 nominatim replication --once
|
||||||
|
working-directory: data-env
|
||||||
|
|
||||||
|
- name: Run reverse-only import
|
||||||
|
run : |
|
||||||
|
echo 'NOMINATIM_DATABASE_DSN="pgsql:dbname=reverse"' >> .env
|
||||||
|
nominatim import --osm-file ../test.pbf --reverse-only --no-updates
|
||||||
|
working-directory: data-env-reverse
|
||||||
|
env:
|
||||||
|
NOMINATIM_DATABASE_DSN: pgsql:dbname=reverse
|
||||||
|
|
||||||
|
- name: Check reverse import
|
||||||
|
run: nominatim admin --check-database
|
||||||
|
working-directory: data-env-reverse
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -ex
|
||||||
#
|
#
|
||||||
# *Note:* these installation instructions are also available in executable
|
# *Note:* these installation instructions are also available in executable
|
||||||
# form for use with vagrant under `vagrant/Install-on-Centos-8.sh`.
|
# form for use with vagrant under `vagrant/Install-on-Centos-8.sh`.
|
||||||
@@ -18,10 +18,12 @@
|
|||||||
sudo dnf install -y epel-release redhat-rpm-config
|
sudo dnf install -y epel-release redhat-rpm-config
|
||||||
|
|
||||||
# EPEL contains Postgres 9.6 and 10, but not PostGIS. Postgres 9.4+/10/11/12
|
# EPEL contains Postgres 9.6 and 10, but not PostGIS. Postgres 9.4+/10/11/12
|
||||||
# and PostGIS 2.4/2.5/3.0 are availble from postgresql.org
|
# and PostGIS 2.4/2.5/3.0 are availble from postgresql.org. Enable these
|
||||||
|
# repositories and make sure, the binaries can be found:
|
||||||
|
|
||||||
sudo dnf -qy module disable postgresql
|
sudo dnf -qy module disable postgresql
|
||||||
sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
|
sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
|
||||||
|
export PATH=/usr/pgsql-12/bin:$PATH
|
||||||
|
|
||||||
# Now you can install all packages needed for Nominatim:
|
# Now you can install all packages needed for Nominatim:
|
||||||
|
|
||||||
@@ -33,9 +35,10 @@
|
|||||||
php-pgsql php php-intl php-json libpq-devel \
|
php-pgsql php php-intl php-json libpq-devel \
|
||||||
bzip2-devel proj-devel boost-devel \
|
bzip2-devel proj-devel boost-devel \
|
||||||
python3-pip python3-setuptools python3-devel \
|
python3-pip python3-setuptools python3-devel \
|
||||||
expat-devel zlib-devel libicu-dev
|
python3-psycopg2 \
|
||||||
|
expat-devel zlib-devel libicu-devel
|
||||||
|
|
||||||
pip3 install --user psycopg2 python-dotenv psutil Jinja2 PyICU datrie pyyaml
|
pip3 install --user python-dotenv psutil Jinja2 PyICU datrie pyyaml
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -54,16 +57,19 @@
|
|||||||
# we assume this user is called nominatim and the installation will be in
|
# we assume this user is called nominatim and the installation will be in
|
||||||
# /srv/nominatim. To create the user and directory run:
|
# /srv/nominatim. To create the user and directory run:
|
||||||
#
|
#
|
||||||
sudo mkdir -p /srv/nominatim #DOCS: sudo useradd -d /srv/nominatim -s /bin/bash -m nominatim
|
# sudo useradd -d /srv/nominatim -s /bin/bash -m nominatim
|
||||||
sudo chown vagrant /srv/nominatim #DOCS:
|
|
||||||
#
|
#
|
||||||
# You may find a more suitable location if you wish.
|
# You may find a more suitable location if you wish.
|
||||||
#
|
#
|
||||||
# To be able to copy and paste instructions from this manual, export
|
# To be able to copy and paste instructions from this manual, export
|
||||||
# user name and home directory now like this:
|
# user name and home directory now like this:
|
||||||
#
|
#
|
||||||
export USERNAME=vagrant #DOCS: export USERNAME=nominatim
|
if [ "x$USERNAME" == "x" ]; then #DOCS:
|
||||||
|
export USERNAME=vagrant #DOCS: export USERNAME=nominatim
|
||||||
export USERHOME=/srv/nominatim
|
export USERHOME=/srv/nominatim
|
||||||
|
sudo mkdir -p /srv/nominatim #DOCS:
|
||||||
|
sudo chown vagrant /srv/nominatim #DOCS:
|
||||||
|
fi #DOCS:
|
||||||
#
|
#
|
||||||
# **Never, ever run the installation as a root user.** You have been warned.
|
# **Never, ever run the installation as a root user.** You have been warned.
|
||||||
#
|
#
|
||||||
@@ -75,21 +81,29 @@ sudo chown vagrant /srv/nominatim #DOCS:
|
|||||||
# ---------------------
|
# ---------------------
|
||||||
#
|
#
|
||||||
# CentOS does not automatically create a database cluster. Therefore, start
|
# CentOS does not automatically create a database cluster. Therefore, start
|
||||||
# with initializing the database, then enable the server to start at boot:
|
# with initializing the database:
|
||||||
|
|
||||||
|
|
||||||
|
if [ "x$NOSYSTEMD" == "xyes" ]; then #DOCS:
|
||||||
|
sudo -u postgres /usr/pgsql-12/bin/pg_ctl initdb -D /var/lib/pgsql/12/data #DOCS:
|
||||||
|
sudo mkdir /var/log/postgresql
|
||||||
|
sudo chown postgres. /var/log/postgresql
|
||||||
|
else #DOCS:
|
||||||
sudo /usr/pgsql-12/bin/postgresql-12-setup initdb
|
sudo /usr/pgsql-12/bin/postgresql-12-setup initdb
|
||||||
sudo systemctl enable postgresql-12
|
fi #DOCS:
|
||||||
|
|
||||||
#
|
#
|
||||||
# Next tune the postgresql configuration, which is located in
|
# Next tune the postgresql configuration, which is located in
|
||||||
# `/var/lib/pgsql/data/postgresql.conf`. See section *Postgres Tuning* in
|
# `/var/lib/pgsql/12/data/postgresql.conf`. See section *Postgres Tuning* in
|
||||||
# [the installation page](../admin/Installation.md#postgresql-tuning)
|
# [the installation page](../admin/Installation.md#postgresql-tuning)
|
||||||
# for the parameters to change.
|
# for the parameters to change.
|
||||||
#
|
#
|
||||||
# Now start the postgresql service after updating this config file.
|
# Now start the postgresql service after updating this config file:
|
||||||
|
|
||||||
|
if [ "x$NOSYSTEMD" == "xyes" ]; then #DOCS:
|
||||||
|
sudo -u postgres /usr/pgsql-12/bin/pg_ctl -D /var/lib/pgsql/12/data -l /var/log/postgresql/postgresql-12.log start #DOCS:
|
||||||
|
else #DOCS:
|
||||||
|
sudo systemctl enable postgresql-12
|
||||||
sudo systemctl restart postgresql-12
|
sudo systemctl restart postgresql-12
|
||||||
|
fi #DOCS:
|
||||||
|
|
||||||
#
|
#
|
||||||
# Finally, we need to add two postgres users: one for the user that does
|
# Finally, we need to add two postgres users: one for the user that does
|
||||||
@@ -140,11 +154,11 @@ fi #DOCS:
|
|||||||
#
|
#
|
||||||
# The webserver should serve the php scripts from the website directory of your
|
# The webserver should serve the php scripts from the website directory of your
|
||||||
# [project directory](../admin/Import.md#creating-the-project-directory).
|
# [project directory](../admin/Import.md#creating-the-project-directory).
|
||||||
# Therefore set up a project directory and populate the website directory:
|
# This directory needs to exist when the webserver is configured.
|
||||||
|
# Therefore set up a project directory and create the website directory:
|
||||||
#
|
#
|
||||||
mkdir $USERHOME/nominatim-project
|
mkdir $USERHOME/nominatim-project
|
||||||
cd $USERHOME/nominatim-project
|
mkdir $USERHOME/nominatim-project/website
|
||||||
nominatim refresh --website
|
|
||||||
#
|
#
|
||||||
# You need to create an alias to the website directory in your apache
|
# You need to create an alias to the website directory in your apache
|
||||||
# configuration. Add a separate nominatim configuration to your webserver:
|
# configuration. Add a separate nominatim configuration to your webserver:
|
||||||
@@ -165,11 +179,15 @@ EOFAPACHECONF
|
|||||||
sudo sed -i 's:#.*::' /etc/httpd/conf.d/nominatim.conf #DOCS:
|
sudo sed -i 's:#.*::' /etc/httpd/conf.d/nominatim.conf #DOCS:
|
||||||
|
|
||||||
#
|
#
|
||||||
# Then reload apache
|
# Then reload apache:
|
||||||
#
|
#
|
||||||
|
|
||||||
|
if [ "x$NOSYSTEMD" == "xyes" ]; then #DOCS:
|
||||||
|
sudo httpd #DOCS:
|
||||||
|
else #DOCS:
|
||||||
sudo systemctl enable httpd
|
sudo systemctl enable httpd
|
||||||
sudo systemctl restart httpd
|
sudo systemctl restart httpd
|
||||||
|
fi #DOCS:
|
||||||
|
|
||||||
#
|
#
|
||||||
# Adding SELinux Security Settings
|
# Adding SELinux Security Settings
|
||||||
@@ -179,18 +197,19 @@ sudo sed -i 's:#.*::' /etc/httpd/conf.d/nominatim.conf #DOCS:
|
|||||||
# with a web server accessible from the Internet. At a minimum the
|
# with a web server accessible from the Internet. At a minimum the
|
||||||
# following SELinux labeling should be done for Nominatim:
|
# following SELinux labeling should be done for Nominatim:
|
||||||
|
|
||||||
|
if [ "x$HAVE_SELINUX" != "xno" ]; then #DOCS:
|
||||||
sudo semanage fcontext -a -t httpd_sys_content_t "/usr/local/nominatim/lib/lib-php(/.*)?"
|
sudo semanage fcontext -a -t httpd_sys_content_t "/usr/local/nominatim/lib/lib-php(/.*)?"
|
||||||
sudo semanage fcontext -a -t httpd_sys_content_t "$USERHOME/nominatim-project/website(/.*)?"
|
sudo semanage fcontext -a -t httpd_sys_content_t "$USERHOME/nominatim-project/website(/.*)?"
|
||||||
sudo semanage fcontext -a -t lib_t "$USERHOME/nominatim-project/module/nominatim.so"
|
sudo semanage fcontext -a -t lib_t "$USERHOME/nominatim-project/module/nominatim.so"
|
||||||
sudo restorecon -R -v /usr/local/lib/nominatim
|
sudo restorecon -R -v /usr/local/lib/nominatim
|
||||||
sudo restorecon -R -v $USERHOME/nominatim-project
|
sudo restorecon -R -v $USERHOME/nominatim-project
|
||||||
|
fi #DOCS:
|
||||||
|
|
||||||
# You need to create a minimal configuration file that tells nominatim
|
# You need to create a minimal configuration file that tells nominatim
|
||||||
# the name of your webserver user:
|
# the name of your webserver user:
|
||||||
|
|
||||||
#DOCS:```sh
|
#DOCS:```sh
|
||||||
echo NOMINATIM_DATABASE_WEBUSER="apache" | tee .env
|
echo NOMINATIM_DATABASE_WEBUSER="apache" | tee $USERHOME/nominatim-project/.env
|
||||||
#DOCS:```
|
#DOCS:```
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ export DEBIAN_FRONTEND=noninteractive #DOCS:
|
|||||||
# Some of the Python packages that come with Ubuntu 18.04 are too old, so
|
# Some of the Python packages that come with Ubuntu 18.04 are too old, so
|
||||||
# install the latest version from pip:
|
# install the latest version from pip:
|
||||||
|
|
||||||
pip3 install --user python-dotenv datrie pyyaml psycopg2
|
pip3 install --user python-dotenv datrie pyyaml psycopg2-binary
|
||||||
|
|
||||||
#
|
#
|
||||||
# System Configuration
|
# System Configuration
|
||||||
|
|||||||
@@ -75,9 +75,9 @@ fi #DOCS:
|
|||||||
# Restart the postgresql service after updating this config file.
|
# Restart the postgresql service after updating this config file.
|
||||||
|
|
||||||
if [ "x$NOSYSTEMD" == "xyes" ]; then #DOCS:
|
if [ "x$NOSYSTEMD" == "xyes" ]; then #DOCS:
|
||||||
sudo pg_ctlcluster 12 main start
|
sudo pg_ctlcluster 12 main start #DOCS:
|
||||||
else #DOCS:
|
else #DOCS:
|
||||||
sudo systemctl restart postgresql #DOCS:
|
sudo systemctl restart postgresql
|
||||||
fi #DOCS:
|
fi #DOCS:
|
||||||
#
|
#
|
||||||
# Finally, we need to add two postgres users: one for the user that does
|
# Finally, we need to add two postgres users: one for the user that does
|
||||||
|
|||||||
Reference in New Issue
Block a user