This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- job: ciml | |
displayName: "Machine Learning CI" | |
pool: | |
vmImage: 'Ubuntu 20.04' | |
steps: | |
- task: PowerShell@2 | |
displayName: 'Run CI Task from make.ps1 in Devcontainer' | |
inputs: | |
targetType: 'inline' | |
script: 'Install-Module -Name PSake -Force && Invoke-psake ./make.ps1 ciml' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Which is equivalent to | |
format = """ | |
$username\ | |
$hostname\ | |
$shlvl\ | |
$kubernetes\ | |
$directory\ | |
$git_branch\ | |
$git_commit\ | |
$git_state\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "random_string" "random" { | |
length = 8 | |
special = false | |
upper = false | |
number = false | |
} | |
resource "azurerm_public_ip" "vpn_ip" { | |
name = "vpn-ip" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
function cleanup() | |
{ | |
echo -e "----> Trap caught! Do cleanup here" | |
} | |
trap cleanup EXIT | |
# imagine some stuff happens here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
pacmd list-sources | \ | |
grep -oP 'index: \d+' | \ | |
awk '{ print $2 }' | \ | |
xargs -I{} pactl set-source-mute {} toggle | |
MUTED=$(pacmd list-sources | grep "muted: no" | wc -l) | |
if (( $MUTED > 0 )); then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
set -x | |
# Push 200mb image | |
dd if=/dev/urandom of=./file.bin bs=1M count=200 | |
docker build -t lawrencegripper/big:200mb . | |
docker push lawrencegripper/big:200mb | |
rm ./file.bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or the definition README at | |
// https://github.com/microsoft/vscode-dev-containers/tree/master/containers/go | |
{ | |
"name": "Go", | |
"dockerFile": "Dockerfile", | |
"runArgs": [ | |
// Uncomment the next line to use a non-root user. On Linux, this will prevent | |
// new files getting created as root, but you may need to update the USER_UID | |
// and USER_GID in .devcontainer/Dockerfile to match your user if not 1000. | |
// "-u", "vscode", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
KIND_CLUSTER_NAME ?= "opa-rego-teammapping" | |
WAIT_FOR_KIND_READY = '{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}' | |
WAIT_FOR_OPA_READY = '{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}' | |
.PHONY: all build test integration | |
all: test kind-integration | |
build: test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# patch we expect to be generated | |
expectedPatch = { | |
"op": "add", | |
"path": "spec/nodeSelector", | |
"value": { | |
"agentpool": "pool1" | |
} | |
} | |
# Helper to check patch is set |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rule: Check if the item submitted is a pod. | |
isPod { | |
input.request.kind.kind == "Pod" | |
} | |
# Rule: Check if pod already has a `nodeSelector` set | |
hasNodeSelector { | |
input.request.object.spec.nodeSelector | |
count(input.request.object.spec.nodeSelector) > 0 | |
} |