Browse Source

pep8

pull/32/head
Daniel Gyulai 3 years ago
parent
commit
b545e84fe5
  1. 1
      alice-ci/src/alice/config.py
  2. 41
      alice-ci/src/alice/runners/pypirepo.py
  3. 1
      alice-ci/src/alice/runners/pythonrunner.py

1
alice-ci/src/alice/config.py

@ -42,7 +42,6 @@ class ConfigHolder:
self.vars[key] = value
self.commit()
def soft_set(self, key, value):
self.vars[key] = value

41
alice-ci/src/alice/runners/pypirepo.py

@ -1,13 +1,10 @@
import logging
from operator import truediv
from xml.dom import NoModificationAllowedErr
import docker
import time
from os.path import join, isdir
from os import getcwd, mkdir
import os
from ..exceptions import NonZeroRetcode, RunnerError, ConfigException
from ..exceptions import RunnerError
from ..config import ConfigHolder
pipconf = """[global]
@ -74,26 +71,26 @@ class PypiRepoRunner:
if job_config.enabled:
if not running:
c = self.client.containers.run(
name = job_config.container_name,
image="pypiserver/pypiserver:latest",
detach=True,
labels={"app": "alice"},
command=["--overwrite", "-P", ".htpasswd", "packages"],
ports={"8080/tcp": job_config.port},
volumes={
package_dir: {
"bind": "/data/packages",
"mode": "rw"
},
htpasswd_file:{
"bind": "/data/.htpasswd",
"mode": "ro"
}
name=job_config.container_name,
image="pypiserver/pypiserver:latest",
detach=True,
labels={"app": "alice"},
command=["--overwrite", "-P", ".htpasswd", "packages"],
ports={"8080/tcp": job_config.port},
volumes={
package_dir: {
"bind": "/data/packages",
"mode": "rw"
},
restart_policy={
"Name": "unless-stopped"
htpasswd_file: {
"bind": "/data/.htpasswd",
"mode": "ro"
}
)
},
restart_policy={
"Name": "unless-stopped"
}
)
c.reload()
print(f"[PyPiRepo] {job_config.container_name} : {c.status}")
cfgh = ConfigHolder.getInstance()

1
alice-ci/src/alice/runners/pythonrunner.py

@ -56,7 +56,6 @@ class PythonRunner:
output.append(line.decode('utf8').strip())
p.wait()
if p.returncode != 0:
#sys.stdout.buffer.write(p.stderr.read())
print("\n".join(output))
raise(RunnerError(f"[PythonRunner] Could not install dependencies: {dependencies} ({p.returncode})"))
logging.info("[PythonRunner] Installation done")

Loading…
Cancel
Save