diff --git a/Dockerfile b/Dockerfile index 6e490815..7701d8de 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,6 +13,9 @@ RUN dnf install -y \ fedmsg-relay \ python-mock \ git \ + # Troubleshooting tools + telnet \ + nc \ && dnf autoremove -y \ && dnf clean all \ && mkdir /opt/module_build_service/ \ @@ -25,5 +28,3 @@ COPY koji.conf /etc/module_build_service/ COPY copr.conf /etc/module_build_service/ COPY . /opt/module_build_service/ - -RUN python2 ./manage.py upgradedb && python2 manage.py generatelocalhostcert diff --git a/docker-compose.yml b/docker-compose.yml index 3f904e89..0d51a40d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,33 +1,51 @@ version: "2" services: + fedmsg-relay: - build: - context: . + build: . command: fedmsg-relay - ports: - - "2003:2003" - - "4001:4001" - module_build_service_daemon: - build: - context: . + expose: + - 2001 + - 2003 + volumes: + # module_build_service sources are bind-mounted, so you don't have to rebuild + - ./:/opt/module_build_service/:z + + scheduler: + build: . command: python2 /opt/module_build_service/module_build_service_daemon.py links: - fedmsg-relay volumes: # module_build_service sources are bind-mounted, so you don't have to rebuild - - ./module_build_service/:/opt/module_build_service/module_build_service/:z + - ./:/opt/module_build_service/:z - ~/.fedora.cert:/root/.fedora.cert:z # koji credentials are mounted inside - ~/.fedora-server-ca.cert:/root/.fedora-server-ca.cert:z - ~/.fedora-upload-ca.cert:/root/.fedora-upload-ca.cert:z - module_build_service: - build: - context: . + + frontend: + build: . ports: - "5000:5000" links: - - module_build_service_daemon + - scheduler - fedmsg-relay + depends_on: + - upgradedb + - generatelocalhostcert volumes: # module_build_service sources are bind-mounted, so you don't have to rebuild - - ./module_build_service/:/opt/module_build_service/module_build_service/:z + - ./:/opt/module_build_service/:z command: python2 manage.py runssl + + upgradedb: + build: . + volumes: + - ./:/opt/module_build_service/:z + command: python2 manage.py upgradedb + + generatelocalhostcert: + build: . + volumes: + - ./:/opt/module_build_service/:z + command: python2 manage.py generatelocalhostcert diff --git a/fedmsg.d/logging.py b/fedmsg.d/logging.py new file mode 100644 index 00000000..0e43586b --- /dev/null +++ b/fedmsg.d/logging.py @@ -0,0 +1,16 @@ +# Setup fedmsg logging. +# See the following for constraints on this format https://bit.ly/Xn1WDn +bare_format = "[%(asctime)s][%(name)10s %(levelname)7s] %(message)s" + +config = dict( + logging=dict( + loggers=dict( + # Quiet this guy down... + requests={ + "level": "WARNING", + "propagate": True, + "handlers": ["console"], + }, + ), + ), +) diff --git a/fedmsg.d/module_build_service.py b/fedmsg.d/module_build_service.py index 2d3b9653..61235801 100644 --- a/fedmsg.d/module_build_service.py +++ b/fedmsg.d/module_build_service.py @@ -1,12 +1,26 @@ config = { + # Just for dev. + "validate_signatures": False, + # Talk to the relay, so things also make it to composer.stg in our dev env "active": True, # Since we're in active mode, we don't need to declare any of our own # passive endpoints. This placeholder value needs to be here for the tests # to pass in Jenkins, though. \o/ - "endpoints": {}, - "relay_inbound": ["tcp://127.0.0.1:2003"], + "endpoints": { + "fedora-infrastructure": [ + # Just listen to staging for now, not to production (spam!) + #"tcp://hub.fedoraproject.org:9940", + "tcp://stg.fedoraproject.org:9940", + ], + "relay_outbound": [ + "tcp://fedmsg-relay:2001" + ], + }, + "relay_inbound": [ + "tcp://fedmsg-relay:2003" + ], # Start of code signing configuration # 'sign_messages': True,