Skip to content

Commit

Permalink
Merge pull request #2 from fidoriel/master
Browse files Browse the repository at this point in the history
additions and fixes to be able to run the (unmaintained) project
  • Loading branch information
lpirl authored Jun 10, 2024
2 parents d6ccc4d + 95d5434 commit f368f0d
Show file tree
Hide file tree
Showing 17 changed files with 230 additions and 229 deletions.
91 changes: 91 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Build

on:
pull_request:
push:
branches: [master]
tags:
- "*"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build_docker:
name: build docker
runs-on: ubuntu-latest

steps:
- name: Check out repository code
uses: actions/checkout@v4

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

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to ghcr
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

- name: Docker fe-meta
id: fe-meta
uses: docker/metadata-action@v4
env:
DOCKER_METADATA_PR_HEAD_SHA: true
with:
images: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
tags: |
type=raw,value=${{ steps.extract_branch.outputs.branch }},enable=${{ github.ref != 'refs/heads/master' && steps.extract_branch.outputs.branch != '' }},prefix=fe-
type=semver,pattern={{raw}},prefix=fe-
type=raw,value=fe-latest,enable=${{ github.ref == 'refs/heads/master' }}
- name: Build and push fe
uses: docker/build-push-action@v4
with:
context: .
file: frontend/Dockerfile
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.fe-meta.outputs.tags }}
platforms: linux/amd64

- name: Docker be-meta
id: be-meta
uses: docker/metadata-action@v4
env:
DOCKER_METADATA_PR_HEAD_SHA: true
with:
images: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
tags: |
type=raw,value=${{ steps.extract_branch.outputs.branch }},enable=${{ github.ref != 'refs/heads/master' && steps.extract_branch.outputs.branch != '' }},prefix=be-
type=semver,pattern={{raw}},prefix=be-
type=raw,value=be-latest,enable=${{ github.ref == 'refs/heads/master' }}
- name: Build and push be
uses: docker/build-push-action@v4
with:
context: .
file: backends/Dockerfile
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.be-meta.outputs.tags }}
platforms: linux/amd64
47 changes: 0 additions & 47 deletions Makefile

This file was deleted.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

# ORE - The Open Reliability Editor (former FuzzEd)

> This is a legacy application without maintenance. This is not meant to run anywhere exposed to the internet. Please make sure to run a reverse proxy with basicauth in front. All versions are pinned so that the `Dockerfile` can build. For a working example please see `docker-compose.yml`. Make sure to remember your username. Because there is no import, you can back up you db with all graphs `docker compose exec ore-db pg_dump -U ore -d ore > backup.sql` and load with `docker-compose exec -T ore-db psql -U ore -d ore < backup.sql`. If the database is already used, you can drop the old one with `docker-compose exec ore-db dropdb -U ore ore` and create an empty new one with `docker-compose exec ore-db createdb -U ore ore`. Make sure to keep all data safe.
Note: FuzzEd becomes ORE. We are in the middle of that process, so don't get confused while both names are still in use.

ORE is an browser-based editor for drawing and analyzing dependability models. The currently supported types are:
Expand Down
23 changes: 23 additions & 0 deletions backends/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Dockerfile for ORE backend

FROM ubuntu:xenial

RUN apt-get update \
&& apt-get install -y texlive \
&& rm -rf /var/lib/apt/lists/*

RUN apt-get update \
&& apt-get install -y libpq-dev python python-pip libboost-dev libboost-graph-dev libboost-date-time-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev cmake gcc libxerces-c-dev xsdcxx \
&& rm -rf /var/lib/apt/lists/*

RUN pip install requests==2.23.0 certifi==2020.6.20

WORKDIR /ore-back/
COPY backends/ /ore-back/
COPY common/ /ore-common/

RUN cmake .
RUN make -j

EXPOSE 8000
CMD ["python", "daemon.py"]
18 changes: 0 additions & 18 deletions backends/docker/Dockerfile.development

This file was deleted.

22 changes: 0 additions & 22 deletions backends/docker/Dockerfile.production

This file was deleted.

2 changes: 0 additions & 2 deletions backends/docker/startup.sh

This file was deleted.

53 changes: 53 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
version: '3'

services:
ore-db-dev:
image: postgres:9
container_name: ore-db-dev
environment:
POSTGRES_PASSWORD: ore
POSTGRES_USER: ore
POSTGRES_DB: ore
volumes:
- postgres-volume-dev:/var/lib/postgresql/data

ore-front-dev:
image: ghcr.io/osmhpi/fuzzed:fe-latest
container_name: ore-front-dev
command: sh -c '/ore-front/manage.py migrate && ./manage.py runserver 0.0.0.0:8000'
build:
context: .
dockerfile: ./frontend/Dockerfile
environment:
ORE_BACKEND_DAEMON: http://ore-back-dev:8000
ORE_SERVER_URL: http://ore-front-dev:8000
ORE_SERVER: ore-front-dev
ORE_DB_NAME: ore
ORE_DB_USER: ore
ORE_DB_PASSWORD: ore
ORE_DB_HOST: ore-db-dev
DJANGO_CONFIGURATION: Dev
ORE_SECRET_KEY: 1234
ORE_DEV_LOGIN: 1
ports:
- 8000:8000
depends_on:
- ore-db-dev
- ore-back-dev
volumes:
- ./frontend:/ore-front
- ./common:/ore-common

ore-back-dev: # to build docker compose exec ore-back-dev cmake . && make
image: ghcr.io/osmhpi/fuzzed:be-latest
container_name: ore-back-dev
build:
context: .
dockerfile: ./backends/Dockerfile
volumes:
- ./backends:/ore-back
- ./common:/ore-common
- /ore-back/lib

volumes:
postgres-volume-dev:
60 changes: 29 additions & 31 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,47 @@
version: '3'

services:
ore-db-dev:
ore-db:
image: postgres:9
container_name: ore-db-dev
container_name: ore-db
environment:
POSTGRES_PASSWORD: ore
POSTGRES_USER: ore
POSTGRES_DB: ore
restart: always
volumes:
- postgres-volume:/var/lib/postgresql/data
ore-front-dev:
image: troeger/ore-front:0.8.4
container_name: ore-front-dev
build:
- postgres-volume:/var/lib/postgresql/data

ore-front:
image: ghcr.io/osmhpi/fuzzed:fe-latest
container_name: ore-front
build:
context: .
dockerfile: ./frontend/docker/Dockerfile.development
dockerfile: ./frontend/Dockerfile
restart: always
environment:
ORE_BACKEND_DAEMON: http://ore-back-dev:8000
ORE_SERVER_URL: http://localhost
ORE_SERVER: localhost # this adds an entry to allowed hosts
ORE_DB_NAME: ore
ORE_DB_USER: ore
ORE_DB_PASSWORD: ore
ORE_DB_HOST: ore-db-dev
ORE_MODE: development
tty: true
ORE_BACKEND_DAEMON: http://ore-back:8000
ORE_SERVER_URL: http://ore-front:8000
ORE_SERVER: ore-front # this adds a host to allowed hosts
ORE_DB_NAME: ore
ORE_DB_USER: ore
ORE_DB_PASSWORD: ore
ORE_DB_HOST: ore-db
ORE_SECRET_KEY: change-me-to-something-random-and-very-secret
ORE_DEV_LOGIN: 1
ports:
- 8000:8000
depends_on:
- ore-db-dev
- ore-back-dev
volumes:
- ./frontend:/ore-front
- ./common:/ore-common
ore-back-dev:
image: troeger/ore-back:0.8.4
container_name: ore-back-dev
build:
- ore-db
- ore-back

ore-back:
image: ghcr.io/osmhpi/fuzzed:be-latest
container_name: ore-back
restart: always
build:
context: .
dockerfile: ./backends/docker/Dockerfile.development
tty: true
volumes:
- ./backends:/ore-back
- ./common:/ore-common
dockerfile: ./backends/Dockerfile

volumes:
postgres-volume:
22 changes: 22 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Dockerfile for ORE web application

FROM ubuntu:bionic

ENV DJANGO_CONFIGURATION=Production
ENV DEBIANFRONTEND=nointeractive

# Prepare Ansible environment
RUN apt-get update \
&& apt-get install -y python python-pip git nodejs \
&& rm -rf /var/lib/apt/lists/*

RUN pip install PyXB==1.2.6 defusedxml==0.7.1 psycopg2-binary==2.8.6 django==1.8.18 python-social-auth==0.2.21 python-openid==2.2.5 python-oauth2==1.1.1 django-require==1.0.11 django-robots==3.1.0 django-configurations==2.0 requests_oauthlib==1.1.0 uwsgi==2.0.18

RUN pip install git+https://github.com/django-tastypie/django-tastypie.git@256ebe1de9a78dfb5d4d6e938b813cf4c5c4ac1b

WORKDIR /ore-front
COPY frontend/ /ore-front

ENV PYTHONUNBUFFERED 1
EXPOSE 8000
CMD sh -c '/ore-front/manage.py collectstatic -v3 --noinput && /ore-front/manage.py migrate && uwsgi --http 0.0.0.0:8000 --wsgi-file ore/wsgi.py --static-map /static/=/ore-front/ore/static-release/'
21 changes: 0 additions & 21 deletions frontend/docker/Dockerfile.development

This file was deleted.

Loading

0 comments on commit f368f0d

Please sign in to comment.