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

Commit

Permalink
Disable feathers sync and other unneeded services in jobs and scripts (
Browse files Browse the repository at this point in the history
…#9594)

* Disable feathers sync and other unneeded services in jobs and scripts

* add back primus
  • Loading branch information
HexaField authored Jan 10, 2024
1 parent f36073a commit 08c3b70
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { argsToObject } from '@etherealengine/common/src/utils/objectToCommandLi
import { ModelTransformParameters } from '@etherealengine/engine/src/assets/classes/ModelTransform'
import { transformModel } from '@etherealengine/engine/src/assets/compression/ModelTransformFunctions'
import { ServerMode } from '@etherealengine/server-core/src/ServerState'
import { createFeathersKoaApp } from '@etherealengine/server-core/src/createApp'
import { createFeathersKoaApp, serverJobPipe } from '@etherealengine/server-core/src/createApp'

const modelTransformParameters: ModelTransformParameters = argsToObject(process.argv.slice(3))

Expand All @@ -56,7 +56,7 @@ cli.enable('status')

cli.main(async () => {
try {
const app = createFeathersKoaApp(ServerMode.API)
const app = createFeathersKoaApp(ServerMode.API, serverJobPipe)
await app.setup()
await transformModel(modelTransformParameters)
cli.exit(0)
Expand Down
2 changes: 2 additions & 0 deletions packages/server-core/src/createApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ export const serverPipe = pipe(configureOpenAPI(), configurePrimus(), configureR
app: Application
) => Application

export const serverJobPipe = pipe(configurePrimus(), configureK8s()) as (app: Application) => Application

export const createFeathersKoaApp = (
serverMode: ServerTypeMode = ServerMode.API,
configurationPipe = serverPipe
Expand Down
4 changes: 2 additions & 2 deletions scripts/archive-directory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import dotenv from 'dotenv-flow'

import { archiverPath } from '@etherealengine/common/src/schema.type.module'
import { ServerMode } from '@etherealengine/server-core/src/ServerState'
import { createFeathersKoaApp } from '@etherealengine/server-core/src/createApp'
import { createFeathersKoaApp, serverJobPipe } from '@etherealengine/server-core/src/createApp'

dotenv.config({
path: appRootPath.path,
Expand Down Expand Up @@ -58,7 +58,7 @@ const options = cli.parse({

cli.main(async () => {
try {
const app = createFeathersKoaApp(ServerMode.API)
const app = createFeathersKoaApp(ServerMode.API, serverJobPipe)
await app.setup()
const { directory, jobId, storageProviderName } = options
await app.service(archiverPath).get(null, {
Expand Down
4 changes: 2 additions & 2 deletions scripts/auto-update-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import appRootPath from 'app-root-path'
import cli from 'cli'
import dotenv from 'dotenv-flow'

import { createFeathersKoaApp } from '@etherealengine/server-core/src/createApp'
import { createFeathersKoaApp, serverJobPipe } from '@etherealengine/server-core/src/createApp'
import { checkProjectAutoUpdate } from '@etherealengine/server-core/src/projects/project/project-helper'
import { ServerMode } from '@etherealengine/server-core/src/ServerState'

Expand Down Expand Up @@ -56,7 +56,7 @@ const options = cli.parse({

cli.main(async () => {
try {
const app = createFeathersKoaApp(ServerMode.API)
const app = createFeathersKoaApp(ServerMode.API, serverJobPipe)
await app.setup()
await checkProjectAutoUpdate(app, options.projectName)
cli.exit(0)
Expand Down
4 changes: 2 additions & 2 deletions scripts/convert-resource-urls-to-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import cli from 'cli'
import dotenv from 'dotenv-flow'

import { ServerMode } from '@etherealengine/server-core/src/ServerState'
import { createFeathersKoaApp } from '@etherealengine/server-core/src/createApp'
import { createFeathersKoaApp, serverJobPipe } from '@etherealengine/server-core/src/createApp'

dotenv.config({
path: appRootPath.path,
Expand Down Expand Up @@ -72,7 +72,7 @@ cli.main(async () => {
})

console.log('options', options)
const app = createFeathersKoaApp(ServerMode.API)
const app = createFeathersKoaApp(ServerMode.API, serverJobPipe)
await app.setup()

const staticResources = await knexClient.from<StaticResourceType>(staticResourcePath)
Expand Down
4 changes: 2 additions & 2 deletions scripts/convert-static-resource-url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import knex from 'knex'
import { StaticResourceDatabaseType, staticResourcePath } from '@etherealengine/common/src/schema.type.module'

import { ServerMode } from '@etherealengine/server-core/src/ServerState'
import { createFeathersKoaApp } from '@etherealengine/server-core/src/createApp'
import { createFeathersKoaApp, serverJobPipe } from '@etherealengine/server-core/src/createApp'
import cli from 'cli'
import dotenv from 'dotenv-flow'

Expand All @@ -55,7 +55,7 @@ cli.main(async () => {
}
})

const app = createFeathersKoaApp(ServerMode.API)
const app = createFeathersKoaApp(ServerMode.API, serverJobPipe)
await app.setup()

type UpdatedStaticResourceType = StaticResourceDatabaseType & {
Expand Down
4 changes: 2 additions & 2 deletions scripts/create-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import dotenv from 'dotenv-flow'

import { projectPath } from '@etherealengine/common/src/schema.type.module'
import { ServerMode } from '@etherealengine/server-core/src/ServerState'
import { createFeathersKoaApp } from '@etherealengine/server-core/src/createApp'
import { createFeathersKoaApp, serverJobPipe } from '@etherealengine/server-core/src/createApp'

dotenv.config({
path: appRootPath.path,
Expand All @@ -56,7 +56,7 @@ const options = cli.parse({

cli.main(async () => {
try {
const app = createFeathersKoaApp(ServerMode.API)
const app = createFeathersKoaApp(ServerMode.API, serverJobPipe)
await app.setup()
const name = options.name.replace(' ', '-')
await app.service(projectPath).create({ name })
Expand Down
4 changes: 2 additions & 2 deletions scripts/install-projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Ethereal Engine. All Rights Reserved.
import { projectPath } from '@etherealengine/common/src/schema.type.module'
import logger from '@etherealengine/server-core/src/ServerLogger'
import { ServerMode } from '@etherealengine/server-core/src/ServerState'
import { createFeathersKoaApp } from '@etherealengine/server-core/src/createApp'
import { createFeathersKoaApp, serverJobPipe } from '@etherealengine/server-core/src/createApp'
import { createDefaultStorageProvider } from '@etherealengine/server-core/src/media/storageprovider/storageprovider'
import { download } from '@etherealengine/server-core/src/projects/project/downloadProjects'
import { getProjectConfig, onProjectEvent } from '@etherealengine/server-core/src/projects/project/project-helper'
Expand All @@ -49,7 +49,7 @@ db.url = process.env.MYSQL_URL ?? `mysql://${db.username}:${db.password}@${db.ho

async function installAllProjects() {
try {
const app = createFeathersKoaApp(ServerMode.API)
const app = createFeathersKoaApp(ServerMode.API, serverJobPipe)
await app.setup()
createDefaultStorageProvider()
const localProjectDirectory = path.join(appRootPath.path, 'packages/projects/projects')
Expand Down
4 changes: 2 additions & 2 deletions scripts/push-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import dotenv from 'dotenv-flow'

import { projectPath, userPath } from '@etherealengine/common/src/schema.type.module'
import { ServerMode } from '@etherealengine/server-core/src/ServerState'
import { createFeathersKoaApp } from '@etherealengine/server-core/src/createApp'
import { createFeathersKoaApp, serverJobPipe } from '@etherealengine/server-core/src/createApp'
import { pushProjectToGithub } from '@etherealengine/server-core/src/projects/project/github-helper'

dotenv.config({
Expand Down Expand Up @@ -62,7 +62,7 @@ const options = cli.parse({

cli.main(async () => {
try {
const app = createFeathersKoaApp(ServerMode.API)
const app = createFeathersKoaApp(ServerMode.API, serverJobPipe)
await app.setup()
const { userId, projectId, reset, commitSHA, storageProviderName, jobId } = options
const user = await app.service(userPath).get(userId)
Expand Down
4 changes: 2 additions & 2 deletions scripts/update-cloudfront-function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import cli from 'cli'

import { InstalledRoutesInterface } from '@etherealengine/common/src/interfaces/Route'
import { routePath } from '@etherealengine/common/src/schema.type.module'
import { createFeathersKoaApp } from '@etherealengine/server-core/src/createApp'
import { createFeathersKoaApp, serverJobPipe } from '@etherealengine/server-core/src/createApp'
import { getStorageProvider } from '@etherealengine/server-core/src/media/storageprovider/storageprovider'
import { ServerMode } from '@etherealengine/server-core/src/ServerState'

Expand All @@ -53,7 +53,7 @@ const options = cli.parse({
})
cli.main(async () => {
try {
const app = await createFeathersKoaApp(ServerMode.API)
const app = await createFeathersKoaApp(ServerMode.API, serverJobPipe)
await app.setup()
const storageProvider = getStorageProvider()
const routes = (await getAllRoutes(app, [], 0)).map((item) => item.route)
Expand Down
4 changes: 2 additions & 2 deletions scripts/update-cronjob-image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import dotenv from 'dotenv-flow'
import { ProjectType, projectPath } from '@etherealengine/common/src/schema.type.module'
import { getState } from '@etherealengine/hyperflux'
import { ServerMode, ServerState } from '@etherealengine/server-core/src/ServerState'
import { createFeathersKoaApp } from '@etherealengine/server-core/src/createApp'
import { createFeathersKoaApp, serverJobPipe } from '@etherealengine/server-core/src/createApp'
import { getCronJobBody } from '@etherealengine/server-core/src/projects/project/project-helper'

dotenv.config({
Expand Down Expand Up @@ -61,7 +61,7 @@ const options = cli.parse({

cli.main(async () => {
try {
const app = createFeathersKoaApp(ServerMode.API)
const app = createFeathersKoaApp(ServerMode.API, serverJobPipe)
await app.setup()
const autoUpdateProjects = (await app.service(projectPath).find({
query: {
Expand Down
4 changes: 2 additions & 2 deletions scripts/update-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import dotenv from 'dotenv-flow'

import { projectPath, userPath } from '@etherealengine/common/src/schema.type.module'
import { ServerMode } from '@etherealengine/server-core/src/ServerState'
import { createFeathersKoaApp } from '@etherealengine/server-core/src/createApp'
import { createFeathersKoaApp, serverJobPipe } from '@etherealengine/server-core/src/createApp'

dotenv.config({
path: appRootPath.path,
Expand Down Expand Up @@ -66,7 +66,7 @@ const options = cli.parse({

cli.main(async () => {
try {
const app = createFeathersKoaApp(ServerMode.API)
const app = createFeathersKoaApp(ServerMode.API, serverJobPipe)
await app.setup()
const { userId, jobId, ...data } = options
data.reset = data.reset === 'true'
Expand Down

0 comments on commit 08c3b70

Please sign in to comment.