Skip to content

Commit

Permalink
Update mlmd service proxy configuration port to 8443
Browse files Browse the repository at this point in the history
Fix DEV_MODE import in mlmd service

Remove DEV_MODE import in mlmd service

Refactor mlmd service proxy configuration

Update mlmd service proxy configuration

Update mlmd service proxy configuration port to 10001
  • Loading branch information
Gkrumbach07 committed May 10, 2024
1 parent bc33d07 commit 72ae934
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ BACKEND_PORT=4000
FRONTEND_PORT=4010

METADATA_ENVOY_SERVICE_HOST=localhost
METADATA_ENVOY_SERVICE_PORT=9090
METADATA_ENVOY_SERVICE_PORT=10001

FASTIFY_LOG_LEVEL=debug

Expand Down
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,17 @@ undeploy:
./install/undeploy.sh

##################################

.PHONY: port-forward
port-forward:
ifdef NAMESPACE
parallel -j0 --lb ::: \
'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 odh-model-registries svc/${MODEL_REGISTRY_NAME} ${MODEL_REGISTRY_SERVICE_PORT}:8080'
else
$(error Missing NAMESPACE variable)
endif

##################################
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'),
);

0 comments on commit 72ae934

Please sign in to comment.