Skip to content

Update README.md#443

Open
SeregaYakovlev wants to merge 1 commit intoOverv:masterfrom
SeregaYakovlev:SeregaYakovlev-readme-patch-1
Open

Update README.md#443
SeregaYakovlev wants to merge 1 commit intoOverv:masterfrom
SeregaYakovlev:SeregaYakovlev-readme-patch-1

Conversation

@SeregaYakovlev
Copy link
Copy Markdown

@SeregaYakovlev SeregaYakovlev commented Feb 15, 2025

Fix: Move REPLICATION_URL and MAX_INTERVAL_SECONDS to the correct part of the Docker command

In the original Docker command, the environment variables REPLICATION_URL and MAX_INTERVAL_SECONDS were incorrectly placed in the run command. These variables are intended to be used during the import process, not during the run command.

This update moves the variables to the appropriate section of the command to ensure proper functionality during data import, where these variables are needed for configuring replication settings.

Changes:

  • Moved REPLICATION_URL and MAX_INTERVAL_SECONDS from the run command to the import command.

Now, the Docker command is correctly configured to import data with replication settings.

Fix: Move REPLICATION_URL and MAX_INTERVAL_SECONDS to the correct part of the Docker command
In the original Docker command, the environment variables REPLICATION_URL and MAX_INTERVAL_SECONDS were incorrectly placed in the run command. These variables are intended to be used during the import process, not during the run command.

This update moves the variables to the appropriate section of the command to ensure proper functionality during data import, where these variables are needed for configuring replication settings.

Changes:
Moved REPLICATION_URL and MAX_INTERVAL_SECONDS from the run command to the import command.
Ensured proper configuration of environment variables for the import process.
Now, the Docker command is correctly configured to import data with replication settings.
@Istador
Copy link
Copy Markdown
Contributor

Istador commented Feb 20, 2025

The REPLICATION_URL is used by the run command during the update cronjob:

wget $REPLICATION_URL/$url_dynamicPart.state.txt -O $WORKOSM_DIR/state.txt

@SeregaYakovlev
Copy link
Copy Markdown
Author

This code starts only while import command.

if [ $# -eq 1 ] ; then
    m_info "Initialising Osmosis replication system to $1"
    mkdir -p $WORKOSM_DIR
    $OSMOSIS_BIN -v 5 --read-replication-interval-init workingDirectory=$WORKOSM_DIR 1>&2 2> "$OSMOSISLOG"

    init_seq=$(/usr/lib/python3-pyosmium/pyosmium-get-changes --server $REPLICATION_URL -D $1)
    url_dynamicPart=$(printf %09d $init_seq | sed 's_\([0-9][0-9][0-9]\)\([0-9][0-9][0-9]\)\([0-9][0-9][0-9]\)_\1/\2/\3_')
    wget $REPLICATION_URL/$url_dynamicPart.state.txt -O $WORKOSM_DIR/state.txt

    cat > $WORKOSM_DIR/configuration.txt <<- EOM
baseUrl=$REPLICATION_URL
maxInterval=$MAX_INTERVAL_SECONDS
EOM
fi

because of

if [ "$1" == "import" ]; then
    if [ "${UPDATES:-}" == "enabled" ] || [ "${UPDATES:-}" == "1" ]; then
        # determine and set osmosis_replication_timestamp (for consecutive updates)
        REPLICATION_TIMESTAMP=`osmium fileinfo -g header.option.osmosis_replication_timestamp /data/region.osm.pbf`

        # initial setup of osmosis workspace (for consecutive updates)
        sudo -E -u renderer openstreetmap-tiles-update-expire.sh $REPLICATION_TIMESTAMP
    fi

in run.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants