awslabs / seed-farmer

Seed-Farmer is an orchestration tool that works with AWS CodeSeeder and acts as an orchestration tool modeled after GitOps deployments. It has a CommandLine Interface based in Python, leverages modular code deployments defined by declarative manifests, and includes change detection and deployment optimization.
https://seed-farmer.readthedocs.io/en/latest/
Apache License 2.0
49 stars 15 forks source link

feat: add parameter to disable env replacement in module params #730

Closed kukushking closed 1 month ago

kukushking commented 1 month ago

Issue #, if available:

Description of changes:

    - eks_ng_name: ng-gdn412xlarge
      eks_node_quantity: 0
      eks_node_max_quantity: 30
      eks_node_min_quantity: 0
      eks_node_disk_size: 500
      eks_node_instance_type: "g4dn.12xlarge"
      use_gpu_ami: True
      eks_node_labels:
        usage: g4dn.12xlarge
        fast-disk-node: pv-nvme
      privateNetworking: true
      preBootstrapCommands:
        - |
          # Install NVMe CLI
          yum install nvme-cli -y

          # Get list of NVMe Drives
          nvme_drives=$(nvme list | grep "Amazon EC2 NVMe Instance Storage" | cut -d " " -f 1 || true)
          readarray -t nvme_drives <<< "$nvme_drives"
          'num_drives=1'
          # Install software RAID utility
          yum install mdadm -y

          # Create RAID-0 array across the instance store NVMe SSDs
         'mdadm --create /dev/md0 --level=0 --name=md0 --raid-devices=$num_drives "${nvme_drives[@]}"'
          # Format drive with Ext4
          mkfs.ext4 /dev/md0

          # Get RAID array's UUID
          uuid=$(blkid -o value -s UUID /dev/md0)

          # Create a filesystem path to mount the disk
          mount_location="/mnt/fast-disks/${uuid}"
          mkdir -p $mount_location

          # Mount RAID device
          mount /dev/md0 $mount_location

          # Have disk be mounted on reboot
          mdadm --detail --scan >> /etc/mdadm.conf 
          echo /dev/md0 $mount_location ext4 defaults,noatime 0 2 >> /etc/fstab

Usage:

name: test-module-1
path: modules/test-module
targetAccount: primary
targetRegion: us-west-2
parameters:
  - name: param1
    disableEnvVarResolution: True
    value:
      - |
        export VAR=test
        echo "${VAR}"

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.