Skip to content

Commit

Permalink
Add MPIJob API reference
Browse files Browse the repository at this point in the history
Signed-off-by: terrytangyuan <[email protected]>
  • Loading branch information
terrytangyuan committed Apr 15, 2020
1 parent 2a05155 commit 1597aa0
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
5 changes: 5 additions & 0 deletions content/docs/reference/mpijob/v1alpha2/mpi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
+++
title = "MPIJob"
description = "Reference documentation for MPIJob"
weight = 100
+++
28 changes: 28 additions & 0 deletions gen-api-reference/gen-mpijob-api.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Change this to where gen-crd-api-reference-docs is extracted
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

# table style substitutions
TABLE_SUB='<div class=\"table-responsive\"><table class=\"table table-bordered\">'
THEAD_SUB='<thead class=\"thead-light\">'

# V1alpha2
CONTENT_DIR=${WEBSITE_ROOT}/content/docs/reference/mpijob/v1alpha2

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

touch temp_mpi.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/mpi-operator/pkg/apis/kubeflow/v1alpha2" -out-file temp_mpi.md
cat temp_mpi.md >> ${CONTENT_DIR}/mpi.md
rm temp_mpi.md

sed 's/<table>/'"$TABLE_SUB"'/g' ${CONTENT_DIR}/mpi.md > temp_mpi.md
sed 's/<thead>/'"$THEAD_SUB"'/g' temp_mpi.md > ${CONTENT_DIR}/mpi.md
rm temp_mpi.md
3 changes: 2 additions & 1 deletion gen-api-reference/kubeflow-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"k8s.io/apimachinery/pkg/apis/": "Kubernetes ",
"github.com/kubeflow/tf-operator/pkg/apis/common": "common",
"github.com/kubeflow/tf-operator/pkg/apis/tensorflow": "tensorflow",
"github.com/kubeflow/pytorch-operator/pkg/apis/pytorch": "pytorch"
"github.com/kubeflow/pytorch-operator/pkg/apis/pytorch": "pytorch",
"github.com/kubeflow/mpi-operator/pkg/apis/kubeflow": "mpi"
},
"markdownDisabled": false
}

0 comments on commit 1597aa0

Please sign in to comment.