cognitedata/inso-bootstrap-cli

Deployment on a fresh project only succeeded on the 2nd try

jpriou opened this issue · 2 comments

Running bootstrap-cli via GitHub action.

When running on a fresh project (i.e. no existing datasets nor rawdb), the first run of the bootstrap cli fails.
Traceback: running-gh-action-fresh-project.txt

  • the datasets were created
  • but possibly not reloaded properly from CDF to get all their dataset internal-ids in line 1252:
        # reload deployed configs to be used as reference for group creation
        time.sleep(5)  # wait for datasets and raw_dbs to be created!
        self.load_deployed_config_from_cdf()

which means the CDF Groups have empty references and produce illegal scopes like

    "scope": {
      "datasetScope": {}
    }

Hypothesis is, that code failed to reload the fresh created datasets before proceeding, which lead to lack of internal dataset-ids and caused error.

where can we copy/paste code which loops/waits until dataset resources are finally created?

  • as we depend (sadly) on the dataset internal-ids (and cannot use the logical external-ids) to create the CDF Group datasetScope
  • I doubt that we have to invent this code

notes for the solution-approach (tbd):

  • eliminate the time.sleep(5)
  • use return value from self.client.data_sets.create(datasets_to_be_created) which includes the created datasets with their internal ids
  • update the self.deployed['datasets'] with the new datasets
  • check for more dependencies, which require reload (groups and rawdbs)