I’m working in a Code Repository with multiple transforms in Foundry, and I want to set up separate environments for DEV, TEST, and PRODUCTION.
My goal is to ensure that:
-
While working on a feature branch, the transforms use DEV-specific resources (like dev datasets, secrets, configs, etc.)
-
When changes are merged into master, the same code automatically switches to use PRODUCTION resources
This should work without hardcoding the environment in the code itself.
In C#, we typically handle this using environment variables and separate config files like appsettings.Development.json or appsettings.Production.json. I’m looking to replicate a similar environment-based configuration pattern in Foundry.
How can I achieve this kind of environment-aware setup in a Code Repository in Foundry?
Thanks!
Hey,
This is best done by using a combination of DevOps + Marketplace! You may need to work with an admin of your Foundry instance (unless this is a personal DevTier stack) to create 3 separate spaces where each corresponds to DEV, TEST, and PRODUCTION.
Your initial work is done with DEV-specific resources in a code repository in the DEV space. Then when you’re satisfied with the progress, you package it up in a new product via DevOps and mark the inputs to each transform as required inputs to the product.
Once you publish that product, you can use Marketplace to install it with a target destination in your TEST space (you can also have the installation create the project for you). Part of the installation process includes marking which datasets in the TEST space you want to use as inputs to the relevant transforms, then you can repeat this process from TEST –> PROD.
Link to relevant documentation:
https://www.palantir.com/docs/foundry/devops-release-management/use-devops-for-release-management/
1 Like
Dev tier doesnt have devops access
No packaging allowed on that tier.
Ah unfortunate — for Dev Tier then (or in the case of any instance of Foundry with exactly one Space), the next best thing is to do things rather manually.
When you create a new code repository, you have just the master branch by default — treat this like PROD. Before writing any code, immediately go to the Setting page and protect the master branch.
Then, create your TEST branch. Once you’re switched over, return to settings to protect the TEST branch.
Finally, create your DEV branch and allow users to make branches off it or to edit it directly. Once satisfied with changes (and potentially after building within the DEV branch, create a standard PR for review and merge if acceptable into TEST. Repeat from TEST to PROD/master.
Make sure to replace the RIDs of input datasets before merging to master! This is what a lot of companies using Foundry did prior to the release of DevOps + Marketplace.
1 Like
Agreed, this approach works for the code repo. Note that, unless you have the new Foundry Branching on your stack, you need to manage these branches independently across Repos, Pipelines, Ontology and Workshop.
Thanks!
I have branch-specific configurations, such as different API endpoints for DEV, TEST, and PROD environments, along with other environment-specific settings.
What’s the best practice for managing these configurations so that, for example, the dev branch connects to dev APIs, the test branch to test APIs, and so on?
Appreciate any insights!