Skip to content
This repository was archived by the owner on Jun 6, 2024. It is now read-only.
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
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ matrix:
- yarn install
script:
- npm test
- npm run coveralls

- language: node_js
node_js: lts/dubnium
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
[logo]: ./pailogo.jpg "OpenPAI"

[![Build Status](https://travis-ci.org/microsoft/pai.svg?branch=master)](https://travis-ci.org/microsoft/pai)
[![Coverage Status](https://coveralls.io/repos/github/microsoft/pai/badge.svg?branch=master)](https://coveralls.io/github/microsoft/pai?branch=master)
[![Join the chat at https://gitter.im/Microsoft/pai](https://badges.gitter.im/Microsoft/pai.svg)](https://gitter.im/Microsoft/pai?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Version](https://img.shields.io/github/release/Microsoft/pai.svg)](https://github.com/Microsoft/pai/releases/latest)

Expand Down
10 changes: 0 additions & 10 deletions src/rest-server/build/rest-server.common.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@

FROM node:carbon

RUN apt-get update && \
apt-get install --assume-yes --no-install-recommends \
dos2unix \
openssh-server \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

WORKDIR /usr/src/app

ENV NODE_ENV=production \
Expand All @@ -36,8 +28,6 @@ RUN yarn --no-git-tag-version --new-version version \
"$(cat version/PAI.VERSION)"
RUN yarn install

RUN dos2unix src/templates/*

EXPOSE ${SERVER_PORT}

CMD ["npm", "start"]
19 changes: 0 additions & 19 deletions src/rest-server/deploy/rest-server.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ spec:
{% endif %}
- mountPath: /group-configuration
name: group-configuration-rest-server
{%- if cluster_cfg["cluster"]["common"]["cluster-type"] == "yarn" %}
- mountPath: /job-exit-spec-configuration
name: job-exit-spec-rest-server
{%- endif %}
{%- if cluster_cfg["cluster"]["common"]["cluster-type"] == "k8s" %}
{%- if cluster_cfg['hivedscheduler']['config']|length > 1 %}
- mountPath: /hived-spec
Expand Down Expand Up @@ -76,16 +72,6 @@ spec:
value: {{ cluster_cfg['hivedscheduler']['webservice'] }}
- name: LOG_MANAGER_PORT
value: "{{ cluster_cfg['log-manager']['port'] }}"
{%- endif %}
{%- if cluster_cfg["cluster"]["common"]["cluster-type"] == "yarn" %}
- name: LAUNCHER_WEBSERVICE_URI
value: {{ cluster_cfg['yarn-frameworklauncher']['webservice'] }}
- name: HDFS_URI
value: hdfs://{{ cluster_cfg['hadoop-name-node']['master-ip'] }}:9000
- name: WEBHDFS_URI
value: http://{{ cluster_cfg['hadoop-name-node']['master-ip'] }}:5070
- name: YARN_URI
value: http://{{ cluster_cfg['hadoop-resource-manager']['master-ip'] }}:8088
{%- endif %}
- name: RATE_LIMIT_API_PER_MIN
value: "{{ cluster_cfg['rest-server']['rate-limit-api-per-min'] }}"
Expand Down Expand Up @@ -162,11 +148,6 @@ spec:
configMap:
name: auth-configuration
{% endif %}
{%- if cluster_cfg["cluster"]["common"]["cluster-type"] == "yarn" %}
- name: job-exit-spec-rest-server
configMap:
name: job-exit-spec-configuration
{%- endif %}
{%- if cluster_cfg["cluster"]["common"]["cluster-type"] == "k8s" %}
{%- if cluster_cfg['hivedscheduler']['config']|length > 1 %}
- name: hived-spec-rest-server
Expand Down
38 changes: 0 additions & 38 deletions src/rest-server/src/config/azure.js

This file was deleted.

123 changes: 0 additions & 123 deletions src/rest-server/src/config/job.js

This file was deleted.

131 changes: 1 addition & 130 deletions src/rest-server/src/config/launcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,75 +20,6 @@
const Joi = require('joi');


// define yarn launcher config schema
const yarnLauncherConfigSchema = Joi.object().keys({
hdfsUri: Joi.string()
.uri()
.required(),
webhdfsUri: Joi.string()
.uri()
.required(),
webserviceUri: Joi.string()
.uri()
.required(),
healthCheckPath: Joi.func()
.arity(0)
.required(),
frameworksPath: Joi.func()
.arity(0)
.required(),
frameworkPath: Joi.func()
.arity(1)
.required(),
frameworkStatusPath: Joi.func()
.arity(1)
.required(),
frameworkAggregatedStatusPath: Joi.func()
.arity(1)
.required(),
frameworkRequestPath: Joi.func()
.arity(1)
.required(),
frameworkExecutionTypePath: Joi.func()
.arity(1)
.required(),
frameworkInfoWebhdfsPath: Joi.func()
.arity(1)
.required(),
webserviceRequestHeaders: Joi.func()
.arity(1)
.required(),
jobRootDir: Joi.string()
.default('./frameworklauncher'),
jobDirCleanUpIntervalSecond: Joi.number()
.integer()
.min(30 * 60)
.default(120 * 60),
jobConfigFileName: Joi.string()
.default('JobConfig.json'),
frameworkDescriptionFilename: Joi.string()
.default('FrameworkDescription.json'),
amResource: Joi.object().keys({
cpuNumber: Joi.number()
.integer()
.min(1)
.default(1),
memoryMB: Joi.number()
.integer()
.min(1024)
.default(4096),
diskType: Joi.number()
.integer()
.default(0),
diskMB: Joi.number()
.integer()
.min(0)
.default(0),
}),
sqlConnectionString: Joi.string()
.required(),
}).required();

// define k8s launcher config schema
const k8sLauncherConfigSchema = Joi.object().keys({
hivedWebserviceUri: Joi.string()
Expand Down Expand Up @@ -144,67 +75,7 @@ const k8sLauncherConfigSchema = Joi.object().keys({

let launcherConfig;
const launcherType = process.env.LAUNCHER_TYPE;
if (launcherType === 'yarn') {
// get config from environment variables
launcherConfig = {
hdfsUri: process.env.HDFS_URI,
webhdfsUri: process.env.WEBHDFS_URI,
webserviceUri: process.env.LAUNCHER_WEBSERVICE_URI,
webserviceRequestHeaders: (namespace) => {
const headers = {
'Accept': 'application/json',
'Content-Type': 'application/json',
};

if (namespace) {
headers['UserName'] = namespace;
}
return headers;
},
jobRootDir: './frameworklauncher',
jobDirCleanUpIntervalSecond: 7200,
jobConfigFileName: 'JobConfig.json',
frameworkDescriptionFilename: 'FrameworkDescription.json',
amResource: {
cpuNumber: 1,
memoryMB: 1024,
diskType: 0,
diskMB: 0,
},
sqlConnectionString: 'unset',
healthCheckPath: () => {
return `${launcherConfig.webserviceUri}/v1`;
},
frameworksPath: () => {
return `${launcherConfig.webserviceUri}/v1/Frameworks`;
},
frameworkPath: (frameworkName) => {
return `${launcherConfig.webserviceUri}/v1/Frameworks/${frameworkName}`;
},
frameworkStatusPath: (frameworkName) => {
return `${launcherConfig.webserviceUri}/v1/Frameworks/${frameworkName}/FrameworkStatus`;
},
frameworkAggregatedStatusPath: (frameworkName) => {
return `${launcherConfig.webserviceUri}/v1/Frameworks/${frameworkName}/AggregatedFrameworkStatus`;
},
frameworkRequestPath: (frameworkName) => {
return `${launcherConfig.webserviceUri}/v1/Frameworks/${frameworkName}/FrameworkRequest`;
},
frameworkExecutionTypePath: (frameworkName) => {
return `${launcherConfig.webserviceUri}/v1/Frameworks/${frameworkName}/ExecutionType`;
},
frameworkInfoWebhdfsPath: (frameworkName) => {
return `${launcherConfig.webhdfsUri}/webhdfs/v1/Launcher/${frameworkName}/FrameworkInfo.json?op=OPEN`;
},
};

const {error, value} = Joi.validate(launcherConfig, yarnLauncherConfigSchema);
if (error) {
throw new Error(`launcher config error\n${error}`);
}
launcherConfig = value;
launcherConfig.type = launcherType;
} else if (launcherType === 'k8s') {
if (launcherType === 'k8s') {
launcherConfig = {
hivedWebserviceUri: process.env.HIVED_WEBSERVICE_URI,
enabledPriorityClass: process.env.LAUNCHER_PRIORITY_CLASS === 'true',
Expand Down
Loading