Skip to content
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

Fix DEV_MODE import in mlmd service #2792

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ FASTIFY_LOG_LEVEL=debug

DSPA_NAME=dspa
METADATA_ENVOY_SERVICE_HOST=localhost
METADATA_ENVOY_SERVICE_PORT=9090
METADATA_ENVOY_SERVICE_PORT=10001
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

port forward will be different

DS_PIPELINE_DSPA_SERVICE_HOST=localhost
DS_PIPELINE_DSPA_SERVICE_PORT=8443

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ undeploy:
port-forward:
ifdef NAMESPACE
parallel -j0 --lb ::: \
'oc port-forward -n ${NAMESPACE} svc/ds-pipeline-metadata-envoy-${DSPA_NAME} ${METADATA_ENVOY_SERVICE_PORT}:9090' \
'oc port-forward -n ${NAMESPACE} svc/ds-pipeline-metadata-envoy-${DSPA_NAME} ${METADATA_ENVOY_SERVICE_PORT}:8443' \
'oc port-forward -n ${NAMESPACE} svc/ds-pipeline-${DSPA_NAME} ${DS_PIPELINE_DSPA_SERVICE_PORT}:8443' \
'oc port-forward -n ${NAMESPACE} svc/${TRUSTYAI_NAME}-tls ${TRUSTYAI_TAIS_SERVICE_PORT}:443'
'oc port-forward -n ${NAMESPACE} svc/${TRUSTYAI_NAME}-tls ${TRUSTYAI_TAIS_SERVICE_PORT}:443' \
'oc port-forward -n odh-model-registries svc/${MODEL_REGISTRY_NAME} ${MODEL_REGISTRY_SERVICE_PORT}:8080'
else
$(error Missing NAMESPACE variable)
Expand Down
51 changes: 21 additions & 30 deletions backend/src/routes/api/service/mlmd/index.ts
Original file line number Diff line number Diff line change
@@ -1,33 +1,24 @@
import { DEV_MODE } from '../../../../utils/constants';
import { DSPipelineKind } from '../../../../types';
import { proxyService } from '../../../../utils/proxy';

export default DEV_MODE
? proxyService<DSPipelineKind>(
{
apiGroup: 'datasciencepipelinesapplications.opendatahub.io',
apiVersion: 'v1alpha1',
kind: 'DataSciencepipelinesApplication',
plural: 'datasciencepipelinesapplications',
},
{
port: 9090,
prefix: 'ds-pipeline-metadata-envoy-',
},
{
// Use port forwarding for local development:
// kubectl port-forward -n <namespace> svc/ds-pipeline-metadata-envoy-dspa 9090:9090
host: process.env.METADATA_ENVOY_SERVICE_HOST,
port: process.env.METADATA_ENVOY_SERVICE_PORT,
},
(resource) =>
resource.spec.dspVersion === 'v2' &&
!!resource.status?.conditions?.find(
(c) => c.type === 'APIServerReady' && c.status === 'True',
),
false,
)
: async () => {
// do nothing
// service is only registered in DEV_MODE
};
export default proxyService<DSPipelineKind>(
{
apiGroup: 'datasciencepipelinesapplications.opendatahub.io',
apiVersion: 'v1alpha1',
kind: 'DataSciencepipelinesApplication',
plural: 'datasciencepipelinesapplications',
},
{
port: 8443,
prefix: 'ds-pipeline-metadata-envoy-',
},
{
// Use port forwarding for local development:
// kubectl port-forward -n <namespace> svc/ds-pipeline-metadata-envoy-dspa 10001:8443
host: process.env.METADATA_ENVOY_SERVICE_HOST,
port: process.env.METADATA_ENVOY_SERVICE_PORT,
},
(resource) =>
resource.spec.dspVersion === 'v2' &&
!!resource.status?.conditions?.find((c) => c.type === 'APIServerReady' && c.status === 'True'),
);
Loading