Skip to content

Commit 17f81e5

Browse files
authored
Merge pull request #40 from dotmesh-io/gitlab_integration
Gitlab integration
2 parents 1b951bb + 7d45ca7 commit 17f81e5

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

dotscience/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
from dotmesh.client import DotmeshClient, DotName
1818

19+
ENV_DOTSCIENCE_BUILDER = 'DOTSCIENCE_BUILDER'
20+
1921
# Paths will be relative to root, not necessarily cwd
2022
def _add_output_path(root, nameset, path):
2123
full_path = os.path.join(root, path)
@@ -678,7 +680,7 @@ def _initiate_build(self, model_id):
678680
while attempt < 120:
679681
attempt += 1
680682
try:
681-
resp = requests.post(self._hostname+f"/v2/models/{model_id}/builds", auth=self._auth, json={})
683+
resp = requests.post(self._hostname+f"/v2/models/{model_id}/builds", auth=self._auth, json={"builder": os.getenv(ENV_DOTSCIENCE_BUILDER)})
682684
if resp.status_code != 201:
683685
raise Exception(f"Error {resp.status_code} on POST to /v2/models/{model_id}/builds: {resp.content}")
684686
build = resp.json()

examples/env.sample

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export DOTSCIENCE_USERNAME=""
22
export DOTSCIENCE_APIKEY=""
33
export DOTSCIENCE_PROJECT_NAME=""
4-
export DOTSCIENCE_HOSTNAME=""
4+
export DOTSCIENCE_URL=""
5+
export DOTSCIENCE_BUILDER=""

examples/train.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
os.getenv("DOTSCIENCE_USERNAME"),
99
os.getenv("DOTSCIENCE_APIKEY"),
1010
os.getenv("DOTSCIENCE_PROJECT_NAME"),
11-
os.getenv("DOTSCIENCE_HOSTNAME")
11+
os.getenv("DOTSCIENCE_URL")
1212
)
1313

1414
import tensorflow as tf

0 commit comments

Comments
 (0)