Skip to content
/ ioccc Public

iaean's hopefully not so much obfuscated CI/CD and containerization contest

License

Notifications You must be signed in to change notification settings

dta4/ioccc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a working, but very simple dummy project, that shall help to

  • integrate open source projects into your On-Prem CI/CD pipeline
  • provide a blue print for Alpine based dockerization

It implements a browser based simulation of reaction-diffusion systems using WebSockets, build in memoriam and as reminiscence to Alan Turing. The 3.045 bytes of code come from Yusuke Endoh and were an IOCCC winner in 2015.

Reaction-diffusion systems, proposed by Alan Turing in [1], are mathematical models in which two chemical substances are transformed into each other (local chemical reactions) and spread out (diffusion). Their interactions sometimes form non-trivial patterns, such as spots, spiral, dappling and labyrinths.

Local build and run

make

# point your browser to http://localhost:10042/ after running the following command
tcpserver -v 127.0.0.1 10042 src/oregonator src/ioccc.txt
^C

make clean

Local docker build and run

docker build --tag=ioccc .

Build the application stuff during docker image building via

  • a single docker build with temporary virtual environments
apk add --no-cache --virtual .fetch-deps ... && \
apk add --no-cache --virtual .build-deps ... && \
... && \
apk del .fetch-deps .build-deps

For the moment a multi-stage Dockerfile is provided. We are working on providing the other two examples.

A working docker-entrypoint.sh skeleton for configuring the container during bootstrapping is provided.
It is strongly recommended to use the entrypoint pattern to initialize container data at runtime from the beginning for each image that is exposing a daemon as the service.

# access the container during development
docker run -p 10042:10042 -it --rm --name ioccc ioccc /bin/bash

# run the container during development
docker run -p 10042:10042 --rm --name ioccc ioccc
^C

# run the container in production
docker run -p 10042:10042 -d --rm --name ioccc ioccc

# point your browser to http://localhost:10042/ in any case...

Releasing

To bump a new version, run locally:

make clean
make release v=0.1.0

You need write permissions to the upstream.
Remember that make is using git hub CLI. There is a Wiki page with some further examples.

TODO

  • automated DockerHub publishing
  • releasing and publishing on GitHub via local build environment
  • provide additional Dockerfiles
  • Tini as explicit init for containers instead of --init
  • mo as mustache template engine
  • improve documentation

Written with StackEdit.


[1] Turing, A. M., "The Chemical Basis of Morphogenesis", Philosophical Transactions of the Royal Society, 1952.

About

iaean's hopefully not so much obfuscated CI/CD and containerization contest

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published