Code Monkey home page Code Monkey logo

bgs-pygeoapi's Introduction

PyGeoAPI

Code for BGS test deployment of PyGeoAPI

Built using docker + kubenetes

Hosted @ https://osgeodev.bgs.ac.uk/pygeoapi/

Data

Currently serving BGS Geology 625k data using OGCAPI - Features.

See https://ogcapi.ogc.org/ for more info on OGC API's

Docker Deployment

  • The build is very minimal as it makes use of standardised functionality in GitLab and Kubernetes.
  • Builds, tests, deploys and secuity scans your deployments.
  • Deploys to Development and DMZ environments
  • Deployment and Networking settings configured using standard Kubernetes objects.

Project Files

  • .gitlab-ci.yml - controls the build, test, deploy stages. You'll need to edit and extend this for your requirements.
  • Dockerfile and content directory - Builds BGS pygeoapi.
  • kube-deploy/kube-config.sh - script used by the CI to setup kubernetes connection
  • kube-deploy/deploy.sh - script used by the CI to deploy the kubernetes config files
  • kube-deploy/manifests - directory of kubernetes config files to apply. By default these configs include: the deployment, networking and docker registry connection details. You can add extra config files in here if you need to.

Credentials

To run access to a Kubernetes cluster and local Docker Registry requires $DOCKER_SECRET.

Environments and Branching Strategies

By default:

  • all branches and tags will deploy to a new seperate development environment.
  • environments are deployed into completely independent and isolated namespaces in the development kubernetes cluster. This makes working on feature branches really nice as you can see the results of your work deployed and tested before integrating into your master or default branch.
  • GitLab automatically manages assigns a unique kubernetes namespace name e.g: <project_name>-<project_id>-<environment>. Which might look like: simple-docker-example-1357-master
  • Kubernetes automatically creates networking rules to allow immediate access to your development deployment e.g. http://simple-docker-example-1357-master.kube-idev.bgslcdevops.test/
  • development environments are automatically removed after 1 week or when the branch is deleted or by manually running the stop job.
  • anything merged into the staging-dmz branch will deploy to the staging dmz kubernetes cluster
  • the APP_HOSTNAME variable in the DMZ deploy section of the .gitlab-ci.yml file should be set to the final application hostname (e.g. simple-docker-example.bgs.ac.uk).
  • it is likely for new applications that an external DNS entry needs to be requested and pointed at the DMZ kubernetes cluster.

Tests and Secuirty Scans

At the bottom of the CI file there is a template include section where a list of standard GitLab templates are imported to test and scan your deployments. The type of scans to include is dependant on your project. As they are generic checks/tests, some of them work better than others. A key one to include for docker builds is the Container-Scanning.gitlab-ci.yml template. Results are stored in artifacts, within the secuity pages of the projects and also visible in Merge Requests.

bgs-pygeoapi's People

Contributors

koalageo avatar wshelley avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.