Installation#
Prerequisites#
Python >=3.10
Get Necessary Credentials#
Either JWT or OAuth
Go to https://your-stack.palantirfoundry.com/workspace/settings/tokens and generate a new token. Copy it for later use in the config.
OAuth credentials, can only be generated on Foundry if you have the necessary privileges.
OAuth credentials consist of a client_id
and optionally a client_secret
, keep these ready for the next steps.
See also
See also OAuthTokenProvider
and Registering third-party applications
Install the Latest Version of Foundry DevTools#
We recommend using a new conda environment or python environment, after you activated it, just run:
pip install 'foundry-dev-tools'
If you want to use everything provided by Foundry DevTools (running transforms locally and the s3 compatible dataset api) you can use the following command:
pip install 'foundry-dev-tools[full]'
conda install -c conda-forge foundry-dev-tools
See also
The installation guide for contributors can be found here.
Check Your Installation#
With the fdt info
command you can check if everything is correctly installed.
Create a Basic Configuration File#
After you’ve installed foundry-dev-tools successfully, run in a shell fdt config edit
.
Select the config file you want to edit. You probably want to edit one of the user configuration files.
See also
Foundry DevTools CLI config command
Without the CLI#
Config Paths#
On all operating systems:
~/.foundry-dev-tools/config.toml (user)
~/.config/foundry-dev-tools/config.toml (user)
Linux:
/etc/foundry-dev-tools/config.toml (system-wide)
macOS:
/Library/Application Support/foundry-dev-tools/config.toml (system-wide)
~/Library/Application Suppport/foundry-dev-tools/config.toml (user)
Windows:
C:\ProgramData\foundry-dev-tools\config.toml (system-wide)
%USERPROFILE%\AppData\Local\foundry-dev-tools\config.toml (user)
%USERPROFILE%\AppData\Roaming\foundry-dev-tools\config.toml (user)
See also
If you’ve never used TOML, here is a quick overview.
Credentials Configuration#
The following contents are needed for the JWT authentication:
[credentials]
domain = "palantir foundry domain"
jwt = "jwt token you generated"
The following contents are needed for the OAuth authentication.
The client secret is optional with the authorization code grant.
[credentials]
domain = "<stack>.palantirfoundry.comp"
[credentials.oauth]
client_id = "client_id"
client_secret = "client_secret" # optional with authorization code grant
[credentials]
domain = "palantir foundry domain"
[credentials.oauth]
client_id = "your client_id"
client_secret = "your client secret" # required with the client credentials grant
grant_type = "client_credentials"
After setting up the configuration, you can execute the following python one-linter to login using OAuth:
python -c "from foundry_dev_tools import FoundryContext; ctx = FoundryContext(); print(ctx.multipass.get_user_info())"
See also
For more info about the configuration: Configuration
PySpark#
The python package PySpark is an optional dependency of Foundry DevTools.
It is required to run transforms
and the CachedFoundryClient
, the PySpark version needs to be at least 3.0.
For PySpark to work, you’ll also need to install Java, but PySpark is currently only compatible with Java 8/11/17.
If you use foundry-dev-tools-transforms
to install, it will install the PySpark dependency as well:
pip install 'foundry-dev-tools-transforms'
Note
TODO: release conda package for transforms
Alternative installation methods, or more information on how to get Spark running, can be found in the PySpark Documentation and the Spark Documentation.