Skip to main content
Version: Next

InterLink Configuration Reference

This guide provides a comprehensive reference for configuring the interLink API server using the InterLinkConfig.yaml file and environment variables.

Configuration Overview

The interLink configuration is defined in pkg/interlink/config.go and consists of several main sections:

  • Core Configuration: Basic interLink and plugin connection settings
  • TLS Configuration: Security settings for encrypted communication
  • Job Script Configuration: Settings for container runtime and job execution
  • Logging Configuration: Control over log output levels
  • Telemetry Configuration: OpenTelemetry tracing setup

Configuration File Structure

The main configuration file is typically located at /etc/interlink/InterLinkConfig.yaml and follows this structure:

# Core InterLink Settings
InterlinkAddress: "0.0.0.0" # IP address for interLink API server
InterlinkPort: "3000" # Port for interLink API server

SidecarURL: "http://localhost" # URL of the InterLink plugin
SidecarPort: "4000" # Port of the InterLink plugin


# Data and Storage
DataRootFolder: "/tmp/interlink" # Root directory for temporary data

# Logging Configuration
VerboseLogging: false # Enable debug level logging
ErrorsOnlyLogging: false # Only log errors (overrides verbose)

# TLS Configuration (optional)
TLS:
Enabled: true # Enable TLS/mTLS
CertFile: "/path/to/cert.pem" # Server certificate file
KeyFile: "/path/to/key.pem" # Server private key file
CACertFile: "/path/to/ca.pem" # CA certificate for client verification

# Job Script Build Configuration (optional)
JobScriptBuildConfig:
singularity_hub:
server: "https://singularityhub.org"
master_token: "your-token"
cache_validity_seconds: 3600

apptainer_options:
executable: "apptainer"
fakeroot: true
containall: true
fuse_mode: "overlayfs"
no_init: false
no_home: false
no_privs: false
nvidia_support: true
cleanenv: false
unsquash: false

volumes_options:
scratch_area: "/tmp/interlink-scratch"
apptainer_cachedir: "/tmp/apptainer-cache"
image_dir: "/tmp/interlink-images"
additional_directories_in_path: []
fuse_sleep_seconds: 5

# Job Script Template (optional)
JobScriptTemplate: |
#!/bin/bash
# Custom job script template

Configuration Reference

Core Configuration

FieldTypeDefaultDescription
InterlinkAddressstring"0.0.0.0"IP address for the interLink API server to bind to
InterlinkPortstring"3000"Port for the interLink API server
SidecarURLstring"http://localhost"Base URL of the InterLink plugin
SidecarPortstring"4000"Port of the InterLink plugin
DataRootFolderstring"/tmp/interlink"Root directory for storing temporary data and job files

Logging Configuration

FieldTypeDefaultDescription
VerboseLoggingboolfalseEnable debug level logging for detailed output
ErrorsOnlyLoggingboolfalseOnly log errors (takes precedence over verbose)

TLS Configuration

The TLS section enables secure communication between interLink components:

FieldTypeRequiredDescription
EnabledboolNoEnable TLS/mTLS for secure communication
CertFilestringIf TLS enabledPath to the server certificate file
KeyFilestringIf TLS enabledPath to the server private key file
CACertFilestringFor mTLSPath to CA certificate for client verification

Job Script Build Configuration

The JobScriptBuildConfig section configures container runtime options and job script generation.

What is a Job?

A job in this context refers to the execution scripts generated by InterLink plugins to run containers on different backend systems (like SLURM, HTCondor, or Docker). The JobScriptBuildConfig allows plugins to customize how these execution scripts are generated and what runtime options are used.

For example:

  • SLURM plugin: Generates SLURM batch scripts with sbatch commands
  • HTCondor plugin: Creates HTCondor ClassAd files
  • Docker plugin: Builds docker run commands
  • Apptainer/Singularity plugin: Constructs apptainer run scripts with specific runtime flags

This configuration is optional and only used by plugins that need to generate custom job execution scripts:

Singularity Hub Configuration

Plugin-Specific Configuration

The Singularity Hub configuration is specific to Apptainer/Singularity-based plugins. This section may be removed in future versions as it's not used by all plugin types. Consider using plugin-specific configuration files instead.

FieldTypeDescription
serverstringSingularity Hub server URL (e.g., https://singularityhub.org)
master_tokenstringAuthentication token for accessing private repositories
cache_validity_secondsintDuration in seconds to cache downloaded images

Apptainer Options

FieldTypeDefaultDescription
executablestring"apptainer"Path to Apptainer/Singularity executable
fakerootboolfalseEnable fakeroot mode for unprivileged execution
containallboolfalseContain all mount points
fuse_modestring""FUSE mount mode (e.g., "overlayfs")
no_initboolfalseSkip container initialization
no_homeboolfalseDon't mount home directory
no_privsboolfalseDrop all privileges
nvidia_supportboolfalseEnable NVIDIA GPU support
cleanenvboolfalseClean environment variables
unsquashboolfalseUnsquash container image

Volume Options

FieldTypeDescription
scratch_areastringTemporary scratch space directory
apptainer_cachedirstringApptainer cache directory
image_dirstringDirectory for storing container images
additional_directories_in_path[]stringAdditional directories to add to PATH
fuse_sleep_secondsintDelay in seconds for FUSE operations

Environment Variable Overrides

The following environment variables can override configuration file values:

Environment VariableConfig FieldDescription
INTERLINKCONFIGPATH-Path to configuration file (default: /etc/interlink/InterLinkConfig.yaml)
INTERLINKURLInterlinkAddressOverride interLink server address
INTERLINKPORTInterlinkPortOverride interLink server port
SIDECARURLSidecarURLOverride InterLink plugin URL
SIDECARPORTSidecarPortOverride InterLink plugin port

Telemetry Configuration

OpenTelemetry tracing is configured through environment variables:

Environment VariableDefaultDescription
TELEMETRY_ENDPOINT"localhost:4317"OTLP endpoint for trace export
TELEMETRY_UNIQUE_IDGenerated UUIDUnique identifier for service instances
TELEMETRY_CA_CRT_FILEPATH-CA certificate for mTLS to telemetry endpoint
TELEMETRY_CLIENT_CRT_FILEPATH-Client certificate for mTLS
TELEMETRY_CLIENT_KEY_FILEPATH-Client private key for mTLS
TELEMETRY_INSECURE_SKIP_VERIFY"false"Skip TLS certificate verification

Command Line Options

The interLink binary supports these command-line flags:

FlagTypeDefaultDescription
-verboseboolfalseEnable debug level logging
-errorsonlyboolfalseOnly log errors
-interlinkconfigpathstring-Path to configuration file

Configuration Examples

Basic Configuration

InterlinkAddress: "0.0.0.0"
InterlinkPort: "3000"
SidecarURL: "http://localhost"
SidecarPort: "4000"
DataRootFolder: "/tmp/interlink"
VerboseLogging: false
ErrorsOnlyLogging: false

TLS-Enabled Configuration

InterlinkAddress: "0.0.0.0"
InterlinkPort: "3000"
SidecarURL: "https://remote-sidecar.example.com"
SidecarPort: "443"
DataRootFolder: "/tmp/interlink"

TLS:
Enabled: true
CertFile: "/etc/ssl/certs/interlink.crt"
KeyFile: "/etc/ssl/private/interlink.key"
CACertFile: "/etc/ssl/certs/ca.crt"

Apptainer/Singularity Configuration

InterlinkAddress: "0.0.0.0"
InterlinkPort: "3000"
SidecarURL: "http://localhost"
SidecarPort: "4000"
DataRootFolder: "/tmp/interlink"

JobScriptBuildConfig:
apptainer_options:
executable: "/usr/bin/apptainer"
fakeroot: true
containall: true
nvidia_support: true
cleanenv: true

volumes_options:
scratch_area: "/scratch/interlink"
apptainer_cachedir: "/var/cache/apptainer"
image_dir: "/var/lib/interlink/images"
fuse_sleep_seconds: 10

Configuration Loading Order

The configuration is loaded in the following priority order:

  1. Command-line flags (highest priority)
  2. Environment variables
  3. Configuration file (lowest priority)

Validation and Troubleshooting

Common Configuration Issues

  1. Port conflicts: Ensure InterlinkPort and SidecarPort don't conflict with other services
  2. File permissions: Verify that certificate files and data directories are readable
  3. Network connectivity: Test connectivity between interLink and sidecar components
  4. TLS certificate validation: Ensure certificate subject names match hostnames

Configuration Validation

The interLink binary validates configuration at startup and will log errors for:

  • Missing required certificate files when TLS is enabled
  • Invalid port numbers or addresses
  • Inaccessible data directories
  • Malformed YAML syntax

Debug Configuration

Enable verbose logging to troubleshoot configuration issues:

# Using command-line flag
./interlink -verbose

# Using environment variable in config
VerboseLogging: true

# Using environment variable
export VERBOSE_LOGGING=true

See Also