Skip to content

Commit

Permalink
Merge pull request #8 from soubinan/feature
Browse files Browse the repository at this point in the history
Improve API with new endpoints
  • Loading branch information
soubinan authored Nov 26, 2023
2 parents 12d1cc2 + fec1aa8 commit 2ae8b94
Show file tree
Hide file tree
Showing 10 changed files with 615 additions and 163 deletions.
21 changes: 15 additions & 6 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,26 @@ FROM python:slim
LABEL maintainer="https://github.com/soubinan"

WORKDIR /app
VOLUME [ "/app/templates" ]

RUN apt-get update -y && apt-get upgrade -y && apt-get install wget -y && apt-get clean -y
RUN wget "https://github.com/coreos/butane/releases/latest/download/butane-x86_64-unknown-linux-gnu" -O ./butane && \
chmod +x ./butane
RUN apt-get update -y && apt-get upgrade -y && apt-get install wget curl -y && apt-get clean -y
RUN wget "https://github.com/coreos/butane/releases/latest/download/butane-x86_64-unknown-linux-gnu" -O /usr/bin/butane && \
chmod +x /usr/bin/butane

COPY main.py main.py
COPY requirements.txt requirements.txt

RUN pip install -U pip && \
pip install -r requirements.txt --no-cache-dir

COPY main.py main.py

ARG version=1.0.0
ENV API_VERSION=$version \
READ_APPEND_ONLY=false

EXPOSE 8000
CMD [ "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]

HEALTHCHECK --interval=15s --timeout=5s --start-period=5s --retries=3 \
CMD curl -s --fail http://127.0.0.1:8000 || exit 1

ENTRYPOINT [ "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--use-colors"]
CMD ["--workers", "1"]
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Ignition Server

Small api aiming to serve ignition manifests dynamically on-the-fly.

## The need

To install [CoreOS](https://fedoraproject.org/coreos/)/[Flatcar](https://www.flatcar.org/) you need to expose the static ignition file via an HTTP server and the use it remotely in your installation live session or you have to copy your static ignition file locally in your installation live session.

The pain increase with th number of servers to deploy.

## The solution

Instead of serve the ignition configs for each deployment you need, you can generate the ignition configs on-the-fly from [butane templates](https://coreos.github.io/butane/specs/) you can customize as you want.

### How to use

```bash
docker pull ghcr.io/soubinan/ignition-server:latest

docker run --rm -v $PWD/templates:/app/templates:Z -p 8000:8000 ghcr.io/soubinan/ignition-server:latest
```

### Demo

<https://ignition-server.soubilabs.xyz>
Loading

0 comments on commit 2ae8b94

Please sign in to comment.