-
Notifications
You must be signed in to change notification settings - Fork 63
Make ghci parts reusable from cunumeric #796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
534f6f1
56e38cb
7c9a36b
fa5b0a7
00c59cc
669ca8a
751f90c
8f47435
72ae463
563d3d6
945c691
465159e
f4c6395
777e05c
34408f2
6549c09
b70e06c
a4c32f6
c0100c7
61d906f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -xuo pipefail | ||
|
|
||
| #Set the options of the getopt command | ||
| format=$(getopt -n "$0" -l "base-image:,image-tag:,source-dir:" -- -- "$@") | ||
| if [ $# -lt 4 ]; then | ||
| echo "Wrong number of arguments passed." | ||
| exit | ||
| fi | ||
| eval set -- "$format" | ||
|
|
||
| #Read the argument values | ||
| while [ $# -gt 0 ] | ||
| do | ||
| case "$1" in | ||
| --base-image) BASE_IMAGE="$2"; shift;; | ||
| --image-tag) IMAGE_TAG="$2"; shift;; | ||
| --source-dir) SOURCE_DIR="$2"; shift;; | ||
| --) shift;; | ||
| esac | ||
| shift; | ||
| done | ||
|
|
||
| set -e | ||
|
|
||
| # Avoid build errors due to a missing .creds folder | ||
| mkdir -p "$SOURCE_DIR/.creds" | ||
|
|
||
| docker build \ | ||
| --build-arg BASE_IMAGE="$BASE_IMAGE" \ | ||
| --build-arg AWS_SESSION_TOKEN="$AWS_SESSION_TOKEN" \ | ||
| --build-arg AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" \ | ||
| --build-arg AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" \ | ||
| --build-arg GITHUB_TOKEN="$GITHUB_TOKEN" \ | ||
| --build-arg USE_CUDA="$USE_CUDA" \ | ||
| --progress=plain \ | ||
| --tag="$IMAGE_TAG" \ | ||
| -f "$SOURCE_DIR/continuous_integration/Dockerfile" "$SOURCE_DIR" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,26 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| entrypoint() { | ||
| sccache_stop_server_and_show_stats() { | ||
| sccache --stop-server || true && sccache --show-stats; | ||
| } | ||
|
|
||
| init_devcontainer() { | ||
| # disable xtrace and history | ||
| local xtrace_enabled=$(echo "${SHELLOPTS:-}" | grep -q 'xtrace'; echo $?); | ||
| local history_enabled=$(echo "${SHELLOPTS:-}" | grep -q 'history'; echo $?); | ||
| { set +xo history; } 2>/dev/null; | ||
| eval "export $(find /run/secrets/ -type f -exec bash -c 'echo ${0/\/run\/secrets\//}=$(<${0})' {} \;)"; | ||
| if [ "${history_enabled}" -eq "0" ]; then { set -o history; } 2>/dev/null; fi; | ||
| if [ "${xtrace_enabled}" -eq "0" ]; then { set -o xtrace; } 2>/dev/null; fi; | ||
|
|
||
| . devcontainer-utils-post-attach-command; | ||
|
|
||
| sleep 10; | ||
| . devcontainer-utils-vault-s3-test; | ||
| . devcontainer-utils-vault-s3-export 0; | ||
| } | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My understanding of this is lacking. :) Why do we need this?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This tests if AWS credentials are valid.
This sets up various SCCACHE_* env vars through ~/.aws/config or ~/.bashrc. These things are required for enabling SCCACHE for "local repro" where AWS auth happens using a GH personal access token.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would also add that the 10 second wait is essential. The credentials that we get are generated on the fly, and need to be uploaded to AWS. We hit authentication issues if we try to race against the upload process.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is also done in the 23.08 devcontainers (and removed in #725). |
||
|
|
||
| entrypoint() { | ||
| set -x | ||
|
|
||
| echo AWS_REGION=${AWS_REGION:-} | ||
|
|
@@ -11,22 +30,12 @@ entrypoint() { | |
|
|
||
| mkdir -p /home/coder/.cache; | ||
|
|
||
| if [ -d /run/secrets ]; then | ||
| # disable xtrace and history | ||
| local xtrace_enabled=$(echo "${SHELLOPTS:-}" | grep -q 'xtrace'; echo $?); | ||
| local history_enabled=$(echo "${SHELLOPTS:-}" | grep -q 'history'; echo $?); | ||
| { set +xo history; } 2>/dev/null; | ||
| eval "export $(find /run/secrets/ -type f -exec bash -c 'echo ${0/\/run\/secrets\//}=$(<${0})' {} \;)"; | ||
| if [ "${history_enabled}" -eq "0" ]; then { set -o history; } 2>/dev/null; fi; | ||
| if [ "${xtrace_enabled}" -eq "0" ]; then { set -o xtrace; } 2>/dev/null; fi; | ||
|
|
||
| . devcontainer-utils-post-attach-command; | ||
| local secrets_dir=/run/secrets | ||
|
|
||
| sleep 10; | ||
| . devcontainer-utils-vault-s3-test; | ||
| . devcontainer-utils-vault-s3-export 0; | ||
| if [ -d "$secrets_dir" ] && [ "$(ls -A $secrets_dir)" ]; then | ||
| init_devcontainer | ||
| else | ||
| sccache --stop-server || true && sccache --show-stats; | ||
| sccache_stop_server_and_show_stats | ||
| fi | ||
|
|
||
| exec "$@"; | ||
|
|
||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably update this to 23.08 version of the devcontainer. Not sure if we should do it here right now or in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do it in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Separate PR would be ideal. Keeping conversation open so we don't forget to do this later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did this in #725