Skip to content

Commit

Permalink
Updated to a more secure bash syntax (#661)
Browse files Browse the repository at this point in the history
  • Loading branch information
rlenferink authored and k8s-ci-robot committed Apr 26, 2019
1 parent 2249350 commit aeccc62
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion content/docs/components/mxnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Before you use the auto-tuning example, there is some preparatory work need to b
To get the status of your job

```bash
kubectl get -o yaml mxjobs $JOB
kubectl get -o yaml mxjobs ${JOB}
```

Here is sample output for an example job
Expand Down
2 changes: 1 addition & 1 deletion content/docs/components/tftraining.md
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ for using GPUs.
To get the status of your job
```bash
kubectl get -o yaml tfjobs $JOB
kubectl get -o yaml tfjobs ${JOB}
```

Here is sample output for an example job
Expand Down
14 changes: 7 additions & 7 deletions content/docs/fairing/gcp-local-notebook.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ your development environment with access to GCP.

```bash
export PROJECT_ID=<your-project-id>
gcloud config set project $PROJECT_ID
gcloud config set project ${PROJECT_ID}
```

1. Kubeflow Fairing needs a service account to make API calls to GCP. The
Expand All @@ -113,7 +113,7 @@ your development environment with access to GCP.
variable, run the following command:

```bash
ls "$GOOGLE_APPLICATION_CREDENTIALS"
ls "${GOOGLE_APPLICATION_CREDENTIALS}"
```

The response should be something like this:
Expand All @@ -127,17 +127,17 @@ your development environment with access to GCP.

```bash
export SA_NAME=<your-sa-name>
gcloud iam service-accounts create $SA_NAME
gcloud projects add-iam-policy-binding $PROJECT_ID \
--member serviceAccount:$SA_NAME@$PROJECT_ID.iam.gserviceaccount.com \
gcloud iam service-accounts create ${SA_NAME}
gcloud projects add-iam-policy-binding ${PROJECT_ID} \
--member serviceAccount:${SA_NAME}@${PROJECT_ID}.iam.gserviceaccount.com \
--role 'roles/editor'
```

Create a key for your service account.

```bash
gcloud iam service-accounts keys create ~/key.json \
--iam-account $SA_NAME@$PROJECT_ID.iam.gserviceaccount.com
--iam-account ${SA_NAME}@${PROJECT_ID}.iam.gserviceaccount.com
```

Create the `GOOGLE_APPLICATION_CREDENTIALS` environment variable.
Expand Down Expand Up @@ -202,7 +202,7 @@ development environments for training and prediction from Kubeflow Fairing.
```bash
export CLUSTER_NAME=kubeflow
export ZONE=us-central1-a
gcloud container clusters get-credentials $CLUSTER_NAME --region $ZONE
gcloud container clusters get-credentials ${CLUSTER_NAME} --region ${ZONE}
```

## Use Kubeflow Fairing to train a model locally and on GCP
Expand Down
4 changes: 2 additions & 2 deletions content/docs/pipelines/sdk/component-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,11 @@ full_image_name=${image_name}:${image_tag}
base_image_tag=1.12.0-py3

cd "$(dirname "$0")"
docker build --build-arg BASE_IMAGE_TAG=$base_image_tag -t "$full_image_name" .
docker build --build-arg BASE_IMAGE_TAG=${base_image_tag} -t "${full_image_name}" .
docker push "$full_image_name"

# Output the strict image name (which contains the sha256 image digest)
docker inspect --format="{{index .RepoDigests 0}}" "$IMAGE_NAME"
docker inspect --format="{{index .RepoDigests 0}}" "${IMAGE_NAME}"
```

Make your script executable:
Expand Down
2 changes: 1 addition & 1 deletion content/docs/pipelines/tutorials/build-pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ For example, to compile the

```bash
export DIR=[YOUR PIPELINES REPO DIRECTORY]/samples/basic
dsl-compile --py $DIR/sequential.py --output $DIR/sequential.tar.gz
dsl-compile --py ${DIR}/sequential.py --output ${DIR}/sequential.tar.gz
```

### Deploy the pipeline
Expand Down
20 changes: 10 additions & 10 deletions gen-api-reference/gen-pytorchjob-api.sh
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
# Change this to where gen-crd-api-reference-docs is extracted
GEN_DOCS=$HOME/gen-crd-api-reference-docs
GEN_DOCS=${HOME}/gen-crd-api-reference-docs

# Change this to where the website repository is cloned.
WEBSITE_ROOT=$GOPATH/src/github.com/kubeflow/website
WEBSITE_ROOT=${GOPATH}/src/github.com/kubeflow/website

# V1beta1
CONTENT_DIR=$WEBSITE_ROOT/content/docs/reference/pytorchjob/v1beta1
CONTENT_DIR=${WEBSITE_ROOT}/content/docs/reference/pytorchjob/v1beta1

echo "+++
title = \"PyTorchJob\"
description = \"Reference documentation for PyTorchJob\"
weight = 100
+++" > $CONTENT_DIR/pytorch.md
+++" > ${CONTENT_DIR}/pytorch.md

$GEN_DOCS/gen-crd-api-reference-docs -config $WEBSITE_ROOT/gen-api-reference/kubeflow-config.json -template-dir $GEN_DOCS/template -api-dir "github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta1" -out-file temp_pytorch.md
cat temp_pytorch.md >> $CONTENT_DIR/pytorch.md
${GEN_DOCS}/gen-crd-api-reference-docs -config ${WEBSITE_ROOT}/gen-api-reference/kubeflow-config.json -template-dir ${GEN_DOCS}/template -api-dir "github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta1" -out-file temp_pytorch.md
cat temp_pytorch.md >> ${CONTENT_DIR}/pytorch.md
rm temp_pytorch.md

# V1beta2
CONTENT_DIR=$WEBSITE_ROOT/content/docs/reference/pytorchjob/v1beta2
CONTENT_DIR=${WEBSITE_ROOT}/content/docs/reference/pytorchjob/v1beta2

echo "+++
title = \"PyTorchJob\"
description = \"Reference documentation for PyTorchJob\"
weight = 100
+++" > $CONTENT_DIR/pytorch.md
+++" > ${CONTENT_DIR}/pytorch.md

$GEN_DOCS/gen-crd-api-reference-docs -config $WEBSITE_ROOT/gen-api-reference/kubeflow-config.json -template-dir $GEN_DOCS/template -api-dir "github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta2" -out-file temp_pytorch.md
cat temp_pytorch.md >> $CONTENT_DIR/pytorch.md
${GEN_DOCS}/gen-crd-api-reference-docs -config ${WEBSITE_ROOT}/gen-api-reference/kubeflow-config.json -template-dir ${GEN_DOCS}/template -api-dir "github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta2" -out-file temp_pytorch.md
cat temp_pytorch.md >> ${CONTENT_DIR}/pytorch.md
rm temp_pytorch.md
32 changes: 16 additions & 16 deletions gen-api-reference/gen-tfjob-api.sh
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
# Change this to where gen-crd-api-reference-docs is extracted
GEN_DOCS=$HOME/gen-crd-api-reference-docs
GEN_DOCS=${HOME}/gen-crd-api-reference-docs

# Change this to where the website repository is cloned.
WEBSITE_ROOT=$GOPATH/src/github.com/kubeflow/website
WEBSITE_ROOT=${GOPATH}/src/github.com/kubeflow/website

# V1beta1
CONTENT_DIR=$WEBSITE_ROOT/content/docs/reference/tfjob/v1beta1
CONTENT_DIR=${WEBSITE_ROOT}/content/docs/reference/tfjob/v1beta1

echo "+++
title = \"TFJob Common\"
description = \"Reference documentation for TFJob\"
weight = 100
+++" > $CONTENT_DIR/common.md
+++" > ${CONTENT_DIR}/common.md

$GEN_DOCS/gen-crd-api-reference-docs -config $WEBSITE_ROOT/gen-api-reference/kubeflow-config.json -template-dir $GEN_DOCS/template -api-dir "github.com/kubeflow/tf-operator/pkg/apis/common/v1beta1" -out-file temp_common.md
cat temp_common.md >> $CONTENT_DIR/common.md
${GEN_DOCS}/gen-crd-api-reference-docs -config ${WEBSITE_ROOT}/gen-api-reference/kubeflow-config.json -template-dir ${GEN_DOCS}/template -api-dir "github.com/kubeflow/tf-operator/pkg/apis/common/v1beta1" -out-file temp_common.md
cat temp_common.md >> ${CONTENT_DIR}/common.md
rm temp_common.md

echo "+++
title = \"TFJob TensorFlow\"
description = \"Reference documentation for TFJob\"
weight = 100
+++" > $CONTENT_DIR/tensorflow.md
+++" > ${CONTENT_DIR}/tensorflow.md

$GEN_DOCS/gen-crd-api-reference-docs -config $WEBSITE_ROOT/gen-api-reference/kubeflow-config.json -template-dir $GEN_DOCS/template -api-dir "github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1" -out-file temp_tensorflow.md
cat temp_tensorflow.md >> $CONTENT_DIR/tensorflow.md
${GEN_DOCS}/gen-crd-api-reference-docs -config ${WEBSITE_ROOT}/gen-api-reference/kubeflow-config.json -template-dir ${GEN_DOCS}/template -api-dir "github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1" -out-file temp_tensorflow.md
cat temp_tensorflow.md >> ${CONTENT_DIR}/tensorflow.md
rm temp_tensorflow.md

# V1beta2
CONTENT_DIR=$WEBSITE_ROOT/content/docs/reference/tfjob/v1beta2
CONTENT_DIR=${WEBSITE_ROOT}/content/docs/reference/tfjob/v1beta2

echo "+++
title = \"TFJob Common\"
description = \"Reference documentation for TFJob\"
weight = 100
+++" > $CONTENT_DIR/common.md
+++" > ${CONTENT_DIR}/common.md

$GEN_DOCS/gen-crd-api-reference-docs -config $WEBSITE_ROOT/gen-api-reference/kubeflow-config.json -template-dir $GEN_DOCS/template -api-dir "github.com/kubeflow/tf-operator/pkg/apis/common/v1beta2" -out-file temp_common.md
cat temp_common.md >> $CONTENT_DIR/common.md
${GEN_DOCS}/gen-crd-api-reference-docs -config ${WEBSITE_ROOT}/gen-api-reference/kubeflow-config.json -template-dir ${GEN_DOCS}/template -api-dir "github.com/kubeflow/tf-operator/pkg/apis/common/v1beta2" -out-file temp_common.md
cat temp_common.md >> ${CONTENT_DIR}/common.md
rm temp_common.md

echo "+++
title = \"TFJob TensorFlow\"
description = \"Reference documentation for TFJob\"
weight = 100
+++" > $CONTENT_DIR/tensorflow.md
+++" > ${CONTENT_DIR}/tensorflow.md

$GEN_DOCS/gen-crd-api-reference-docs -config $WEBSITE_ROOT/gen-api-reference/kubeflow-config.json -template-dir $GEN_DOCS/template -api-dir "github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta2" -out-file temp_tensorflow.md
cat temp_tensorflow.md >> $CONTENT_DIR/tensorflow.md
${GEN_DOCS}/gen-crd-api-reference-docs -config ${WEBSITE_ROOT}/gen-api-reference/kubeflow-config.json -template-dir ${GEN_DOCS}/template -api-dir "github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta2" -out-file temp_tensorflow.md
cat temp_tensorflow.md >> ${CONTENT_DIR}/tensorflow.md
rm temp_tensorflow.md

0 comments on commit aeccc62

Please sign in to comment.