Skip to content

Commit

Permalink
MobilityDB-Workshop 1.1 - documentation and docker generation
Browse files Browse the repository at this point in the history
  • Loading branch information
mschoema authored Oct 4, 2023
2 parents 29a1574 + 6dbae0a commit e3c042f
Show file tree
Hide file tree
Showing 68 changed files with 246 additions and 6 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/docker-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Docker image
on:
push:
branches:
- '*'
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
pull_request:
branches:
- '*'
jobs:
build:
name: Build & push docker image
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
psql: [15]
postgis: [3.4]
os: [ubuntu-latest]

env:
IMG_NAME: ${{ github.repository }}
steps:
- name: Checkout
uses: actions/[email protected]

- name: Info
run: echo "Parameters. ${{ github.event.base_ref }}, ${{ github.ref_type }}, ${{ github.ref }}"

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
context: .
file: ./docker/Dockerfile
push: true
tags: mobilitydb/mobilitydb:${{ matrix.psql }}-${{ matrix.postgis }}-1.0-workshop
build-args: |
POSTGRES_VERSION=${{ matrix.psql }}
POSTGIS_VERSION=${{ matrix.postgis }}
95 changes: 95 additions & 0 deletions .github/workflows/generate_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Automatic generation of documentation will be copied and checked into the
# gh-pages branch.
name: Documentation generation CI

on:
push:
paths:
- '.github/workflows/generate_docs.yml'
- 'docs/**'
branches:
- master
- develop

jobs:
build:
name: Generate documentation
runs-on: ubuntu-latest

steps:
# checkout branch
- name: Checkout repository
uses: actions/checkout@v4
with:
sparse-checkout: docs

# Install dblatex
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y dblatex dbtoepub xsltproc
# generate the documentation files
- name: Generate documentation
run: |
cd docs
dblatex -s texstyle.sty mobilitydb-workshop.xml
dbtoepub -o mobilitydb-workshop.epub mobilitydb-workshop.xml
mkdir html
xsltproc --stringparam html.stylesheet "docbook.css" --stringparam chunker.output.encoding "UTF-8" --xinclude -o html/index.html /usr/share/xml/docbook/stylesheet/docbook-xsl/html/chunk.xsl mobilitydb-workshop.xml
cp -r images docbook.css html/
cp docbook.css html/
# store the documentation files
- name: Upload output directory
uses: actions/upload-artifact@v2
with:
name: doc-files
path: |
docs/index.md
docs/mobilitydb-workshop.pdf
docs/mobilitydb-workshop.epub
docs/html/docbook.css
docs/html/images/*
docs/html/*.html
retention-days: 1


copy:
name: Deploy documentation
runs-on: ubuntu-latest
needs: build

steps:
# checkout the gh-pages branch
- uses: actions/checkout@v3
with:
ref: gh-pages

# download the doc files, most of which are generated above
- name: Download output directory
uses: actions/download-artifact@v2
with:
name: doc-files
path: docs-temp

# Rename the directory to master
- name: Rename the directory to master
if: ${{ github.ref == 'refs/heads/master' }}
run: |
rm -rf master
mv docs-temp master
# Rename the directory to master
- name: Rename the directory to develop
if: ${{ github.ref == 'refs/heads/develop' }}
run: |
rm -rf develop
mv docs-temp develop
# add, commit and push to gh-pages
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
message: 'Update docs'
branch: gh-pages
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ of the modules.

## Documentation

You can generate the workshop documentation from the sources. Go to `/doc` directory and run:
You can generate the workshop documentation from the sources. Go to `/docs` directory and run:
* In HTML format
```bash
xsltproc --stringparam html.stylesheet "docbook.css" --xinclude -o index.html /usr/share/xml/docbook/stylesheet/docbook-xsl/html/chunk.xsl mobilitydb-workshop.xml
xsltproc --stringparam html.stylesheet "docbook.css" --stringparam chunker.output.encoding "UTF-8" --xinclude -o index.html /usr/share/xml/docbook/stylesheet/docbook-xsl/html/chunk.xsl mobilitydb-workshop.xml
```
* In PDF format
```bash
Expand All @@ -21,13 +21,21 @@ You can generate the workshop documentation from the sources. Go to `/doc` direc
```
In addition, pre-generated versions of them are available.

* In HTML format: https://docs.mobilitydb.com/MobilityDB-workshop/master/
* In PDF format: https://docs.mobilitydb.com/MobilityDB-workshop/master/mobilitydb-workshop.pdf
* In EPUB format: https://docs.mobilitydb.com/MobilityDB-workshop/master/mobilitydb-workshop.epub
Master branch:

* In HTML format: https://mobilitydb.github.io/MobilityDB-workshop/master/html/index.html
* In PDF format: https://mobilitydb.github.io/MobilityDB-workshop/master/mobilitydb-workshop.pdf
* In EPUB format: https://mobilitydb.github.io/MobilityDB-workshop/master/mobilitydb-workshop.epub

Develop branch:

* In HTML format: https://mobilitydb.github.io/MobilityDB-workshop/develop/html/index.html
* In PDF format: https://mobilitydb.github.io/MobilityDB-workshop/develop/mobilitydb-workshop.pdf
* In EPUB format: https://mobilitydb.github.io/MobilityDB-workshop/develop/mobilitydb-workshop.epub

## How the Repo is Organized
- `/data`: raw data files used for some workshops
- `/doc`: files needed to generate the workshop documentation from sources
- `/docs`: files needed to generate the workshop documentation from sources

## Docker container

Expand Down
56 changes: 56 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
ARG POSTGRES_VERSION
ARG POSTGIS_VERSION

FROM postgis/postgis:$POSTGRES_VERSION-$POSTGIS_VERSION

# Configuration Parameters
LABEL maintainer="MobilityDB Project - https://github.com/MobilityDB/MobilityDB"
ENV POSTGRES_DB=mobilitydb
ENV POSTGRES_USER=docker
ENV POSTGRES_PASSWORD=docker
ENV MOBILITYDB_VERSION $MOBDB_VERSION

# Fix the Release file expired problem
RUN echo "Acquire::Check-Valid-Until \"false\";\nAcquire::Check-Date \"false\";" | cat > /etc/apt/apt.conf.d/10no--check-valid-until


# Install Prerequisites
RUN apt-get update \
&& apt-get install -y \
build-essential \
cmake \
git \
libproj-dev \
g++ \
wget \
autoconf \
autotools-dev \
libgeos-dev \
libpq-dev \
libproj-dev \
libjson-c-dev \
protobuf-c-compiler \
xsltproc \
libgsl-dev \
libgslcblas0 \
postgresql-server-dev-${PG_MAJOR} \
&& rm -rf /var/lib/apt/lists/*

# Install MobilityDB
RUN wget -O MobilityDB.tar.gz "https://github.com/MobilityDB/MobilityDB/archive/v1.0.tar.gz" \
&& mkdir -p /usr/local/src/MobilityDB \
&& tar \
--extract \
--file MobilityDB.tar.gz \
--directory /usr/local/src/MobilityDB \
--strip-components 1 \
&& rm MobilityDB.tar.gz
RUN mkdir /usr/local/src/MobilityDB/build
RUN cd /usr/local/src/MobilityDB/build && \
cmake .. && \
make -j$(nproc) && \
make install

RUN rm /docker-entrypoint-initdb.d/10_postgis.sh
COPY ./docker/initdb-mobilitydb.sh /docker-entrypoint-initdb.d/mobilitydb.sh
RUN chmod +x /docker-entrypoint-initdb.d/mobilitydb.sh
11 changes: 11 additions & 0 deletions docker/initdb-mobilitydb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

echo "shared_preload_libraries = 'postgis-3.so'" >> $PGDATA/postgresql.conf

set -e

# Create the 'mobilitydb' extension in the mobilitydb database
echo "Loading MobilityDB extension into mobilitydb"
psql --user="$POSTGRES_USER" --dbname="mobilitydb" <<- 'EOSQL'
CREATE EXTENSION IF NOT EXISTS mobilitydb CASCADE;
EOSQL
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
14 changes: 14 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<img src="https://MobilityDB.github.io/MobilityDB-workshop/images/mobilitydb-logo.png"
alt="MobilityDB icon"
style="float: center; margin-right: 10px;" />

-----------------------------------------------
# **Documentation of the MobilityDB Workshop**
-----------------------------------------------


The documentation is available in the following formats

* [PDF](./mobilitydb-workshop.pdf)
* [EPUB](./mobilitydb-workshop.epub)
* [HTML](./html/index.html)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit e3c042f

Please sign in to comment.