From 7762fb7adbc22d7de54794126f06df3601468436 Mon Sep 17 00:00:00 2001 From: Filip Valder Date: Fri, 16 Dec 2016 12:42:16 +0100 Subject: [PATCH] communication with pdc-updater devel + docs --- Vagrantfile | 1 + docker-compose.yml | 2 ++ docs/CONTRIBUTING.rst | 28 +++++++++++++++++++++++++++- fedmsg.d/module_build_service.py | 7 ++++--- 4 files changed, 34 insertions(+), 4 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 489d969a..37ca112e 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -45,6 +45,7 @@ Vagrant.configure("2") do |config| config.vm.synced_folder "./", "/tmp/module_build_service" config.vm.provision "file", source: "/var/tmp/krbcc", destination: "/var/tmp/krbcc", run: "always" config.vm.network "forwarded_port", guest: 5000, host: 5000 + config.vm.network "forwarded_port", guest: 2001, host: 5001 config.vm.network "forwarded_port", guest: 13747, host: 13747 config.vm.provision "shell", inline: $script config.vm.provision :shell, inline: "mbs-frontend &", run: "always" diff --git a/docker-compose.yml b/docker-compose.yml index abd5f6c2..a348e567 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,6 +16,8 @@ services: expose: - 2001 - 2003 + ports: + - "5001:2001" volumes_from: - base diff --git a/docs/CONTRIBUTING.rst b/docs/CONTRIBUTING.rst index f999bf1c..2f2f2e17 100644 --- a/docs/CONTRIBUTING.rst +++ b/docs/CONTRIBUTING.rst @@ -12,7 +12,33 @@ starting your development environment, run the following:: If you have problems in later steps with kerberos reading those credentials inside the `scheduler` container, you should check that `/var/tmp/krbcc` exists on your machine and that *it is not a directory*. Try removing it with `$ sudo -rm -rf /var/tmp/krbcc` and running `kinit` again. +rm -rf /var/tmp/krbcc` and running `kinit` again. Also, check for permissions +and SELinux context of the credentials cache file. + +PDC and pdc-updater +------------------- + +For communication with PDC, you will need to check accessibility of `PDC_URL` +(see your local `config.py`). + +For communication with pdc-updater, you will need SSH connection to the machine, +which provides development instance. + +Your `ssh_config` should look like this:: + + Host MODULARITY-DEV + HostName modularity.fedorainfracloud.org + User fedora + RemoteForward 300x 127.0.0.1:5001 # x is one of 0...9 + +Provided that this is configuration of endpoints where pdc-updater sits, typically +`/etc/fedmsg.d/endpoints.py` (on the machine given above):: + + endpoints={ + "rida.local": [ + "tcp://127.0.0.1:300%i" % i for i in range(10) + ], + ... Docker ------ diff --git a/fedmsg.d/module_build_service.py b/fedmsg.d/module_build_service.py index 27d948d1..1e115543 100644 --- a/fedmsg.d/module_build_service.py +++ b/fedmsg.d/module_build_service.py @@ -36,9 +36,10 @@ config = { # End of code signing configuration } -# Try to figure out if we're running inside a docker-compose container -# http://stackoverflow.com/questions/20010199 -if os.path.exists('/.dockerenv'): +# developer's instance (docker/vagrant/...) +if 'MODULE_BUILD_SERVICE_DEVELOPER_ENV' in os.environ and \ + os.environ['MODULE_BUILD_SERVICE_DEVELOPER_ENV'].lower() in ( + '1', 'on', 'true', 'y', 'yes'): config['endpoints']['relay_outbound'] = ["tcp://fedmsg-relay:2001"] config['relay_inbound'] = ["tcp://fedmsg-relay:2003"] else: