Code Monkey home page Code Monkey logo

ioccc's Introduction

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.

ioccc's People

Contributors

iaean 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.