If you're joining an existing project, follow these steps to get up and running:
Before starting, ensure you have the following installed on your local machine:
- Docker Desktop (for containerization)
- VSCode with the "Dev Containers" extension
- Git (for version control)
git --versiongit config --global user.namegit config --global user.emailIf Git is not installed or configured, follow these steps:
Install Git:
- Windows: Download from git-scm.com
- macOS:
brew install gitor download from git-scm.com - Linux:
sudo apt-get install git(Ubuntu/Debian) or equivalent for your distribution
Configure Git:
git config --global user.name "Your Name"git config --global user.email "your.email@booking.com"git clone git@gitlab.com:..url../project_name.gitcd project_nameNote: Once your request for GIT Passport Policy is approved, you should receive a link to your project's repo. Using the Code button, copy the "Clone with HTTPS" url and replace in the clone command.
If SSH doesn't work, use HTTPS with Personal Access Token:
git clone https://gitlab.com/booking-com/personal/username/project_name.gitcode .- VSCode will detect the
.devcontainerconfiguration - Click "Reopen in Container" when prompted
- VSCode will automatically build the container and install all extensions
- Wait for the container to build (this may take a few minutes on first run)
cp .env.example .envThis is the most critical step! Edit your .env file with your actual Snowflake credentials:
nano .envRequired Configuration: Replace the placeholder values with your actual Snowflake information:
# === Snowflake Base Configuration ===
SF_BASE_ACCOUNT=your_actual_snowflake_account_locator
SF_BASE_WAREHOUSE=your_default_compute_warehouse
# === Local Development Configuration ===
SF_USER_USERNAME=your_snowflake_username
SF_USER_ROLE=your_snowflake_development_role
SF_USER_DATABASE=your_development_database_name
SF_USER_SCHEMA=PUBLIC
**Choose ONE authentication method:**
#### Option A: Password Authentication (Simplest)
###Uncomment and fill in:
# SF_USER_PASSWORD=your_snowflake_password
#### Option B: SSO Authentication (Recommended for Enterprise)
### No additional variables needed for basic SSO
#### Option C: Key-Pair Authentication (Most Secure)
### Uncomment and fill in:
SF_USER_PRIVATE_KEY_PATH=/app/keys/your_private_key_filename.p8
SF_USER_PRIVATE_KEY_PASSPHRASE=your_key_passphrase_if_encryptedImportant Notes:
- Your
.envfile andkeys/folder contains sensitive credentials - never commit it to Git - Ask your team lead for the correct values for your environment
Edit the target setting in dbt_project/profiles.yml to match your chosen authentication method:
nano dbt_project/profiles.ymlChange the target: line at the top to one of:
target: local_password(for password auth)target: local_sso(for SSO auth)target: local_keypair(for key-pair auth)- place your private key file inside the
keys/folder
- place your private key file inside the
cd /app/dbt_projectdbt depsThis installs all required dbt packages including:
- dbt_utils (utility macros)
- dbt_expectations (data quality tests)
- dbt_artifacts (execution metadata)
- codegen (code generation helpers)
dbt debugExpected Output:
Configuration:
profiles.yml file [OK found and valid]
dbt_project.yml file [OK found and valid]
Required dependencies:
- git [OK found]
Connection:
account: your_account
user: your_username
database: your_database
schema: your_schema
warehouse: your_warehouse
role: your_role
All checks passed!
If you see errors:
- Double-check your
.envfile values - Verify your Snowflake access permissions
- Ensure the target in
profiles.ymlmatches your authentication method - Ask your team lead for help with Snowflake credentials
# Run all models - automatically creates schemas and collects metadata
dbt run# Run tests to validate data quality
dbt test# Run for different environments (if you have access)
dbt run --target qadbt run --target prod# Run only your project models (excludes dbt_artifacts)
dbt run --exclude package:dbt_artifacts# Compile models without running them
dbt compile# Generate documentation
dbt docs generate# Serve documentation locally
dbt docs serveOnce set up, you'll be working with this structure:
project_name/
├── .env (your personal credentials - not in Git)
├── .env.example (template)
├── keys/ (your private keys - not in Git)
├── dbt_project/
│ ├── profiles.yml (Snowflake connections)
│ ├── dbt_project.yml (main project config)
│ ├── packages.yml (dbt dependencies)
│ ├── models/
│ │ ├── staging/ (raw data transformations)
│ │ ├── marts/ (core business logic)
│ │ └── reports/ (final outputs)
│ ├── macros/ (custom SQL functions)
│ ├── seeds/ (static data files)
│ ├── snapshots/ (historical data tracking)
│ └── tests/ (data quality tests)
└── [Docker and VSCode config files]
The dev container automatically installs these helpful extensions:
- Cody AI: AI coding assistant for dbt development
- dbt Extensions: Syntax highlighting, formatting, shortcuts
- dbt Power User: Advanced dbt development features
- Python Extension Pack: For Python models and analysis
- Jupyter: For data exploration notebooks
# Work on specific models
dbt run --select model_name
dbt run --select staging.*
dbt run --select marts.dim_table_name+
# Test specific models
dbt test --select model_name
dbt test --select staging.*
# Fresh start (clean and rebuild)
dbt clean
dbt deps
dbt run# Generate model boilerplate
dbt run-operation generate_model_yaml --args '{"model_names": ["model_name"]}'
# Generate source boilerplate
dbt run-operation generate_source --args '{"schema_name": "raw_schema", "database_name": "database"}'# Generate and serve docs
dbt docs generate
dbt docs serve --port 8001-
"Could not connect to Snowflake"
- Verify your
.envfile has correct values - Check that your Snowflake user is active
- Ensure your role has proper permissions
- Verify your
-
"Database/Schema does not exist"
- Ask your team lead to verify your database access
- Check if you're using the correct database name in
.env
-
"Authentication failed"
- For password auth: verify your password is correct (deprecating auth method)
- For SSO: ensure you're logged into your SSO provider
- For key-pair: verify your private key file path and passphrase
# Test SSH connection to GitLab
ssh -T git@gitlab.com
# If SSH fails, try HTTPS with Personal Access Token
git remote set-url origin https://gitlab.com/path/to/repo.git- If the container won't start: Try "Dev Containers: Rebuild Container" in VSCode
- If extensions aren't loading: Check the "Extensions" tab in VSCode
- If you get permission errors: Ensure Docker Desktop is running
- Check the logs: Look in
dbt_project/logs/for detailed error messages - Ask your team: Your team lead can help with Snowflake credentials and permissions
- Use Cody AI: The AI assistant can help with dbt syntax and best practices
- DBT Documentation: docs.getdbt.com
After successful setup:
- Explore the existing models in
models/staging/andmodels/marts/ - Review the documentation by running
dbt docs serve - Check out the sources defined in
models/staging/sources.yml - Start with small changes to understand the project structure
- Ask questions - your team is here to help!
Remember: Never commit your .env file or keys/ folder to Git. These contain sensitive credentials and are automatically ignored by Git.