CICD Project Deployment

Options
ben_engel
ben_engel Partner, Registered Posts: 1 Partner

Hi there, I'm trying to connect DSS to gitlab cicd to upload exported projects automatically.

But I get a wired bug. In core it boils down to the question how to use import_bundle_from_stream.

Below you'll see my deploy script. What kind of stream expect the method? I'm using an full access api key.

import os
import dataikuapi

api_key = os.environ['APIKEY']
bundle = os.environ['DATAIKUBUNDLE']
url = os.environ['DATAIKUURL']

client = dataikuapi.DSSClient(host=url, api_key=api_key)
#new_project = client.create_project('TEST_PROJECT', 'test project', 'tester', description='a simple description')
project = client.get_project('BASKETBALLv2')
with open(os.path.join('demos',bundle), 'rb') as bundle_stream:
project.import_bundle_from_stream(bundle_stream)

Error log:

&#27;[32;1m$ python deploy.sh&#27;[0;mTraceback (most recent call last):File "/usr/local/lib/python3.6/site-packages/dataikuapi/dssclient.py", line 854, in _perform_httphttp_res.raise_for_status()File "/usr/local/lib/python3.6/site-packages/requests/models.py", line 940, in raise_for_statusraise HTTPError(http_error_msg, response=self)requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: http://XXXXXXX/dip/publicapi/projects/BASKETBALLv2/bundles/imported/actions/importFromStreamDuring handling of the above exception, another exception occurred:Traceback (most recent call last):File "deploy.sh", line 12, in <module>project.import_bundle_from_stream(bundle_stream)File "/usr/local/lib/python3.6/site-packages/dataikuapi/dss/project.py", line 633, in import_bundle_from_streamfiles=files)File "/usr/local/lib/python3.6/site-packages/dataikuapi/dssclient.py", line 864, in _perform_emptyself._perform_http(method, path, params=params, body=body, files=files, stream=False, raw_body=raw_body)File "/usr/local/lib/python3.6/site-packages/dataikuapi/dssclient.py", line 861, in _perform_httpraise DataikuException("%s: %s" % (ex.get("errorType", "Unknown error"), ex.get("message", "No message")))dataikuapi.utils.DataikuException: com.dataiku.dip.exceptions.UnauthorizedException: Failed to read project permissionssection_end:1582238860:build_script&#27;[0Ksection_start:1582238860:after_script&#27;[0Ksection_end:1582238861:after_script&#27;[0Ksection_start:1582238861:upload_artifacts_on_failure&#27;[0Ksection_end:1582238863:upload_artifacts_on_failure&#27;[0K&#27;[31;1mERROR: Job failed: exit code 1&#27;[0;m

Answers

  • Young-Sang
    Young-Sang Dataiker Posts: 10 Dataiker
    Options

    Hi Ben.

    Can you clarify what you want to do?
    Which node are you importing the project? Design or Automation?
    Which file do you have with you? Bundle zip file or the project export zip file?

Setup Info
    Tags
      Help me…