Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
remove log url prefix (#5271)
Browse files Browse the repository at this point in the history
In some deploy mode. The PAI master may be behind the firewall and can not be accessed through outside. In this case, WEBPORTAL_URL will be an internal IP. Client can not use this IP to retrieve log.
Remove this prefix, let client use default domain (the gateway IP) to retrieve log,
  • Loading branch information
Binyang2014 authored Feb 3, 2021
1 parent 30f21b3 commit 65df0d7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/rest-server/src/models/v2/job/log.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const createError = require('@pai/utils/error');
const { encodeName } = require('@pai/models/v2/utils/name');

const LOG_MANAGER_PORT = process.env.LOG_MANAGER_PORT;
const WEBPORTAL_URL = process.env.WEBPORTAL_URL;

const constrcutLogManagerPrefix = (nodeIp) => {
return `http://${nodeIp}:${LOG_MANAGER_PORT}/api/v1`;
Expand Down Expand Up @@ -93,7 +92,7 @@ const getLogListFromLogManager = async (
const logList = res.data;

const ret = { locations: [] };
const urlPrefix = `${WEBPORTAL_URL}/log-manager/${nodeIp}:${LOG_MANAGER_PORT}`;
const urlPrefix = `/log-manager/${nodeIp}:${LOG_MANAGER_PORT}`;
const urlSuffix = tailMode === 'true' ? '&tail-mode=true' : '';
for (const key in logList) {
ret.locations.push({
Expand Down

0 comments on commit 65df0d7

Please sign in to comment.