Skip to main content
Solved

Setting up Azure DevOps Pipelines with the Cognite Toolkit

  • February 11, 2025
  • 8 replies
  • 118 views

Forum|alt.badge.img+1

I am trying to deploy data model using CDF toolkit in my azure devops pipeline. So I checked the following page: https://docs.cognite.com/cdf/deploy/cdf_toolkit/guides/cicd/ado_setup
 

However, I see this message in top which says that its still in alpha stage.
 

 

We need this deployment to be done in our prod environments so what is current recommended approach. Also let me know when this feature is expected to be available.

Best answer by Anders Albert

@Khilesh Sahu Toolkit requires at least three levels modules/my_module/data_models.

The reasoning is as follows:

  1. modules/ - where you keep all your modules. A module is a group of resources that solves a problem. For example a data pipelione.
  2. my_module/ - Is the name of the of your module. A configuration for multiple CDF-projects typically have many modules.
  3. data_models/ - This is a resource folder. Toolkit uses specific resource folders with fixed names, to make all modules look similar. The data_models resource folder is used for resources such as spaces, views, containers, nodes, edges, and so on.

In addition, when you run cdf build you can chose which modules to include by

  1. Using the --modules/-m flag in the build command and either pass in a path or the name of the module you want to build.
  2. Use the `selected` key in the config.dev.yaml. That supports the name of the module (the folder name) or a path to the module/module(s) you want to build.

Did I answer your question?

View original
Did this topic help you find an answer to your question?

8 replies

Mithila Jayalath
Seasoned Practitioner
Forum|alt.badge.img

@Khilesh Sahu It looks like the documnetation needs to be updated. The ado-pipeline feature is no longer an alpha feature from version 0.4.0 onwards. 

Thank you for reporting this. I’ll inform the documentation team regarding this.

FYI ​@Anders Albert 


Forum|alt.badge.img+1
  • Author
  • Committed
  • 17 replies
  • February 12, 2025
Mithila Jayalath wrote:

@Khilesh Sahu It looks like the documnetation needs to be updated. The ado-pipeline feature is no longer an alpha feature from version 0.4.0 onwards. 

Thank you for reporting this. I’ll inform the documentation team regarding this.

FYI ​@Anders Albert 


@Mithila Jayalath ​@Anders Albert 


Thanks Mithila for clarifying it.

Do we still have to add the feature flag in cdf.toml?

Also, I see that .devops folder get created as per docs but where my views, containers, space and data models yaml files should be located. Documentation mostly mentioned about .devops and deployment but not clarify where all resources yaml files should be located.

Additionally, lets say we want to maintain different versions of views and model. Later, deploy specific versions using toolkit so how should be the folder structure and what would be recommended steps to approach it?


Anders  Albert
Seasoned Practitioner
Forum|alt.badge.img
  • Seasoned Practitioner
  • 108 replies
  • February 12, 2025

Do we still have to add the feature flag in cdf.toml?

@Khilesh Sahu No need to have the feature flag in the `cdf.toml`. Will update the docs.

Also, I see that .devops folder get created as per docs but where my views, containers, space and data models yaml files should be located. Documentation mostly mentioned about .devops and deployment but not clarify where all resources yaml files should be located.

The resource YAML should be located in the modules folder, as described in the setup guide. https://docs.cognite.com/cdf/deploy/cdf_toolkit/guides/setup#step-3-initialize-the-configuration-files-and-modules

Additionally, lets say we want to maintain different versions of views and model. Later, deploy specific versions using toolkit so how should be the folder structure and what would be recommended steps to approach it?

Currently we do not have a general recommendation for how to maintain multiple versions of the same views. You have typically two ways, either you maintain one YAML file for each version or you only have the latest. I would maintain two versions if both are in use, thus needs to be governed. If the previous version is no longer in use, I think it sufficient to have the older one in your version control history, and only actively govern the latest.


Forum|alt.badge.img+1
  • Author
  • Committed
  • 17 replies
  • February 12, 2025
Anders Albert wrote:

 

The resource YAML should be located in the modules folder, as described in the setup guide. https://docs.cognite.com/cdf/deploy/cdf_toolkit/guides/setup#step-3-initialize-the-configuration-files-and-modules

 

@Anders Albert  thank you for prompt reply.


I tried to have folder structure like /modules/data_models, however I am getting following error:

ERROR (ToolkitMissingModuleError): The following selected modules are missing,

please check path: {PosixPath('modules')}.

HINT A module is a directory with one or more resource directories in it.

Available resource directories are ['3dmodels', 'auth', 'classic',

'data_models', 'data_sets', 'extraction_pipelines', 'files', 'functions',

'hosted_extractors', 'locations', 'raw', 'robotics', 'streamlit', 'timeseries',

'transformations', 'workflows']


So when I tried again with structure like /modules/custom/my_module/data_models. Then it works fine.

I tried this because when I ran toolkit from my local machine and selected following option during cdf modules init then it created similar folder structure. Other option did not work for me that time:
 

 

But this too much folder levels for me I would like to have only /modules/data_models.

 

Here is my config.dev.yaml selected module part
environment:
  name: dev
  project: <my-project>
  type: dev
  selected:
  - modules/

 

So if I can give very specific folder path for “modules” in config.dev.yaml then I would be able to manage different versions of data models using different folders.


Forum|alt.badge.img+1
  • Author
  • Committed
  • 17 replies
  • February 13, 2025

@Anders Albert / ​@Mithila Jayalath  - awaiting response


Forum|alt.badge.img+1
  • Author
  • Committed
  • 17 replies
  • February 17, 2025

@Anders Albert / ​@Mithila Jayalath  - any update on this?


Anders  Albert
Seasoned Practitioner
Forum|alt.badge.img
  • Seasoned Practitioner
  • 108 replies
  • Answer
  • February 17, 2025

@Khilesh Sahu Toolkit requires at least three levels modules/my_module/data_models.

The reasoning is as follows:

  1. modules/ - where you keep all your modules. A module is a group of resources that solves a problem. For example a data pipelione.
  2. my_module/ - Is the name of the of your module. A configuration for multiple CDF-projects typically have many modules.
  3. data_models/ - This is a resource folder. Toolkit uses specific resource folders with fixed names, to make all modules look similar. The data_models resource folder is used for resources such as spaces, views, containers, nodes, edges, and so on.

In addition, when you run cdf build you can chose which modules to include by

  1. Using the --modules/-m flag in the build command and either pass in a path or the name of the module you want to build.
  2. Use the `selected` key in the config.dev.yaml. That supports the name of the module (the folder name) or a path to the module/module(s) you want to build.

Did I answer your question?


Forum|alt.badge.img+1
  • Author
  • Committed
  • 17 replies
  • February 17, 2025

Yes ​@Anders Albert, thank you 😊


Reply


Cookie Policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings