Skip to content

Commit

Permalink
fix: fix bugs in recursive dir detection.
Browse files Browse the repository at this point in the history
Signed-off-by: Electronic-Waste <2690692950@qq.com>
  • Loading branch information
Electronic-Waste committed Dec 11, 2024
1 parent f3088b2 commit a63e300
Show file tree
Hide file tree
Showing 4 changed files with 2,124 additions and 6 deletions.
5 changes: 2 additions & 3 deletions hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,15 @@ CODEGEN_PKG=$(go list -m -mod=readonly -f "{{.Dir}}" k8s.io/code-generator)

cd "$CURRENT_DIR/.."

echo "${CODEGEN_PKG}"
# shellcheck source=/dev/null
source "${CODEGEN_PKG}/kube_codegen.sh"

echo "Generating conversion and defaults functions for config.kubeflow.org ..."
echo "Generating deepcopy and defaults for config.kubeflow.org ..."
kube::codegen::gen_helpers \
--boilerplate "${KATIB_ROOT}/hack/boilerplate/boilerplate.go.txt" \
"${KATIB_ROOT}/pkg/apis/config"

echo "Generating clients for config.kubeflow.org ..."
echo "Generating clients for v1beta1"
kube::codegen::gen_client \
--boilerplate "${KATIB_ROOT}/hack/boilerplate/boilerplate.go.txt" \
--output-dir "${KATIB_ROOT}/pkg/client/controller" \
Expand Down
14 changes: 12 additions & 2 deletions hack/update-openapigen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,25 @@ OPENAPI_PKG=$(go list -m -mod=readonly -f "{{.Dir}}" k8s.io/kube-openapi)
echo ">> Using ${OPENAPI_PKG}"

VERSION_LIST=(v1beta1)
SWAGGER_VERSION="0.1"

for VERSION in "${VERSION_LIST[@]}"; do
echo "Generating OpenAPI specification for ${VERSION} ..."
SWAGGER_CODEGEN_FILE=${KATIB_ROOT}/pkg/apis/${VERSION}/swagger.json

echo "Generating OpenAPI specification for ${VERSION} ..."

go run "${OPENAPI_PKG}/cmd/openapi-gen" \
--go-header-file "${KATIB_ROOT}/hack/boilerplate/boilerplate.go.txt" \
--output-pkg "${KATIB_PKG}/pkg/apis/${VERSION}" \
--output-dir "${KATIB_ROOT}/pkg/apis/${VERSION}" \
--output-file "zz_generated.openapi.go" \
--report-filename "${KATIB_ROOT}/hack/violation_exception_${VERSION}.list" \
"${KATIB_ROOT}/pkg/apis/controller"
"${KATIB_ROOT}/pkg/apis/controller/common/${VERSION}" \
"${KATIB_ROOT}/pkg/apis/controller/experiments/${VERSION}" \
"${KATIB_ROOT}/pkg/apis/controller/suggestions/${VERSION}" \
"${KATIB_ROOT}/pkg/apis/controller/trials/${VERSION}"

echo "Generating OpenAPI Swagger for ${VERSION} ..."

go run "${KATIB_ROOT}/hack/swagger/main.go" "${VERSION}-${SWAGGER_VERSION}" "${VERSION}" >"${SWAGGER_CODEGEN_FILE}"
done
30 changes: 30 additions & 0 deletions hack/violation_exception_v1beta1.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
API rule violation: list_type_missing,github.com/kubeflow/katib/pkg/apis/controller/common/v1beta1,AlgorithmSpec,AlgorithmSettings
API rule violation: list_type_missing,github.com/kubeflow/katib/pkg/apis/controller/common/v1beta1,EarlyStoppingSpec,AlgorithmSettings
API rule violation: list_type_missing,github.com/kubeflow/katib/pkg/apis/controller/common/v1beta1,FilterSpec,MetricsFormat
API rule violation: list_type_missing,github.com/kubeflow/katib/pkg/apis/controller/common/v1beta1,ObjectiveSpec,AdditionalMetricNames
API rule violation: list_type_missing,github.com/kubeflow/katib/pkg/apis/controller/common/v1beta1,ObjectiveSpec,MetricStrategies
API rule violation: list_type_missing,github.com/kubeflow/katib/pkg/apis/controller/common/v1beta1,Observation,Metrics
API rule violation: list_type_missing,github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1,ExperimentSpec,Parameters
API rule violation: list_type_missing,github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1,ExperimentStatus,Conditions
API rule violation: list_type_missing,github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1,ExperimentStatus,EarlyStoppedTrialList
API rule violation: list_type_missing,github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1,ExperimentStatus,FailedTrialList
API rule violation: list_type_missing,github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1,ExperimentStatus,KilledTrialList
API rule violation: list_type_missing,github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1,ExperimentStatus,MetricsUnavailableTrialList
API rule violation: list_type_missing,github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1,ExperimentStatus,PendingTrialList
API rule violation: list_type_missing,github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1,ExperimentStatus,RunningTrialList
API rule violation: list_type_missing,github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1,ExperimentStatus,SucceededTrialList
API rule violation: list_type_missing,github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1,FeasibleSpace,List
API rule violation: list_type_missing,github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1,GraphConfig,InputSizes
API rule violation: list_type_missing,github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1,GraphConfig,OutputSizes
API rule violation: list_type_missing,github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1,NasConfig,Operations
API rule violation: list_type_missing,github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1,Operation,Parameters
API rule violation: list_type_missing,github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1,OptimalTrial,ParameterAssignments
API rule violation: list_type_missing,github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1,TrialTemplate,TrialParameters
API rule violation: list_type_missing,github.com/kubeflow/katib/pkg/apis/controller/suggestions/v1beta1,SuggestionStatus,AlgorithmSettings
API rule violation: list_type_missing,github.com/kubeflow/katib/pkg/apis/controller/suggestions/v1beta1,SuggestionStatus,Conditions
API rule violation: list_type_missing,github.com/kubeflow/katib/pkg/apis/controller/suggestions/v1beta1,SuggestionStatus,Suggestions
API rule violation: list_type_missing,github.com/kubeflow/katib/pkg/apis/controller/suggestions/v1beta1,TrialAssignment,EarlyStoppingRules
API rule violation: list_type_missing,github.com/kubeflow/katib/pkg/apis/controller/suggestions/v1beta1,TrialAssignment,ParameterAssignments
API rule violation: list_type_missing,github.com/kubeflow/katib/pkg/apis/controller/trials/v1beta1,TrialSpec,EarlyStoppingRules
API rule violation: list_type_missing,github.com/kubeflow/katib/pkg/apis/controller/trials/v1beta1,TrialSpec,ParameterAssignments
API rule violation: list_type_missing,github.com/kubeflow/katib/pkg/apis/controller/trials/v1beta1,TrialStatus,Conditions
Loading

0 comments on commit a63e300

Please sign in to comment.