Skip to content

Commit

Permalink
Merge pull request #2792 from Gkrumbach07/task/RHOAIENG-5443-switch-t…
Browse files Browse the repository at this point in the history
…o-targeting-mlmd-oauth-port-and-remove-dev

Fix DEV_MODE import in mlmd service
  • Loading branch information
openshift-merge-bot[bot] authored May 10, 2024
2 parents 814b201 + 601874e commit baa33fc
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 33 deletions.
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
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'),
);

0 comments on commit baa33fc

Please sign in to comment.