Skip to content

Commit

Permalink
PLAT-2802: Set metrics server up to be installed in agent cfg (#76)
Browse files Browse the repository at this point in the history
* Set metrics server up to be installed in agent cfg

* Allow deployer image override in PRs

* Make it less likely we need to scale up

* AttachVolume needs to match instance tags

Chose a tag that's on both volumes and instances instead, and it's
also independent of any sort of "deployment tracking" so hopefully
leaves us free to change that schema if desired.

* Sigh at black
  • Loading branch information
Secretions authored Oct 11, 2021
1 parent 95a00cf commit 59c49bc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: 16
- name: Determine deployer image
env:
PR_BODY: ${{ github.event.pull_request.body }}
run: |
export PR_DEPLOYER_IMAGE=$(echo $PR_BODY | grep -oP "deployer_image: \K\S+")
export DEPLOYER_IMAGE=${PR_DEPLOYER_IMAGE:-$DEPLOYER_IMAGE}
echo Using deployer image: $DEPLOYER_IMAGE
echo "DEPLOYER_IMAGE=$DEPLOYER_IMAGE" >> $GITHUB_ENV
- name: Install dependencies
run: |
pip install -r requirements.txt
Expand Down Expand Up @@ -60,7 +68,7 @@ jobs:
BASE_DOMAIN: ${{ secrets.DELTA_BASE_DOMAIN }}
run: |
export NAME=cdk-deploy-${GITHUB_SHA:0:6}
./util.py generate_config_template --name $NAME --aws-region=us-west-2 --aws-account-id=$AWS_ACCOUNT_ID --dev --registry-username $REGISTRY_USERNAME --registry-password $REGISTRY_PASSWORD --hostname $NAME.$BASE_DOMAIN --acm-cert-arn $ACM_CERT_ARN --disable-flow-logs > config.yaml
./util.py generate_config_template --name $NAME --aws-region=us-west-2 --aws-account-id=$AWS_ACCOUNT_ID --dev --platform-nodegroups 2 --registry-username $REGISTRY_USERNAME --registry-password $REGISTRY_PASSWORD --hostname $NAME.$BASE_DOMAIN --acm-cert-arn $ACM_CERT_ARN --disable-flow-logs > config.yaml
./util.py load_config -f ./config.yaml
- name: Test default config (single and nested stacks)
env:
Expand Down
1 change: 1 addition & 0 deletions cdk/domino_cdk/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def generate_install_config(
"bucket": buckets["registry"].bucket_name,
}
},
"metrics_server": {"install": True},
"gpu": {"enabled": True},
"helm": {
"cache_path": "charts",
Expand Down
4 changes: 3 additions & 1 deletion cdk/domino_cdk/provisioners/eks/eks_iam.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ def provision(self, stack_name: str, cluster_name: str, r53_zone_ids: List[str],
"ec2:ModifyVolume",
],
resources=["*"],
conditions={"StringLike": {"aws:ResourceTag/deploy_id": cluster_name}},
conditions={
"StringLike": {f"aws:ResourceTag/kubernetes.io/cluster/{stack_name}": "owned"}
}, # We can't use token cluster_name here, but should be the same
),
iam.PolicyStatement(
effect=iam.Effect.ALLOW,
Expand Down

0 comments on commit 59c49bc

Please sign in to comment.