Skip to content

Commit

Permalink
Sidecar feature (#2033)
Browse files Browse the repository at this point in the history
* applied sideCar logic from branch release_v2.4

* added swagger from release_v2.4 for sidecar

* minor change

* updated sidecars swagger

* updated volumes examples

* added logging for sideCars

* seperated lines for better readability

* fixed error handling

* updated test nfs root

* fixed bug

* readability improved + fixed timestamp

* swagger design

* improved description

* added logging

* fixed volumeType field required bug

* added method for container names + jsdoc

* changed logging to support sideCars as well

* updated oneOf require

* wip

* wip

* updated swagger

* fixed some logic

* updated consts version

* podStatus consts changed

* logging

* fixed undefined

* logging

* extra logs

* fixes and logs

* removed condition added in last commit

* wip

* now checking status until its running, before changing state to ready

* continuation to last commit

* removed unused code

* bug fix when no car

* wip

* changed logs retrival logic

* wip

* added logging

* pod events log wip

* log pod events wip

* wip

* wip

* wip

* fixed undefined assignment

* wip

* wip

* correct path to events

* removed not necessary code

* adding a warning once any kind of volume doesnt exist

* fix wip

* wip

* fixed error

* wip

* added algorithn name

* added warning codes

* handling different warnings now

* edited message

* .

* removed debugging logging

* seperated pod status between sidecar and algorunner errors

* updated consts package

* .

* format message

* fixed bug when worker is not bootstraping

* handling case when reading sidecar logs

* fix for logging

* jsdoc

* .

* wip

* fix wip

* wip timestamp

* fix

* fix wip

* fix to bug - condition was always true since js compares objects by reference, not value - UNRELATED TO FEATURE, FOUND ON THE WAY

* undo last work - wasnt good. Added logs for proxy

* added newly adde k8s api tests & stub data

* added , (error because merging)

* added tests for algorithm spec with pvc/configmap/secret exist/no exist, and test for emptyDir

* updates for logs, wip

* wip

* modified log-proxy to monitor sidecars as well

* delay increase

* removed own logging

* wip ( removed formatting of sideCar log )

* fix undefined

* wip

* wip

* wip

* wip

* sideCar online logging

* wip

* updated to not always get logs of sideCars to every fetching kind.

* handling ALL situation

* added query to request sideCar logs, when asks for specific one, and also when algorithm is down (since pod is down, it won`t be an option to obtain the car name)

* wip

* removed debug check logging

* fixed bug where sideCar was handled like ALGORITHM

* fixed double logs

* .

* made sidecar prefix to be upper case (like with wrapper)

* updated query`s schema

* bug fix for 'all' source when using es

* fixed possible bug when there are more then 1 sidecars, and also 'all' source bug

* fixed argument name

* updated sideCar container to single object instead of array, and updated env to key:value pairs.

* .

* SideCar Prefix removed

* updated logs retrival to be more modular

* fixed undefined

* updated schema

* fixed condition
  • Loading branch information
Adir111 authored Dec 29, 2024
1 parent 1ddacee commit ad81f66
Show file tree
Hide file tree
Showing 38 changed files with 10,453 additions and 1,071 deletions.
4 changes: 2 additions & 2 deletions core/api-server/api/graphql/resolvers.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ class GraphqlResolvers {
}

async queryLogs(query) {
const { taskId, podName, source, nodeKind, logMode, pageNum, sort, limit, searchWord, taskTime } = query;
const logs = await logsQueries.getLogs({ taskId, podName, source, nodeKind, logMode, pageNum, sort, limit, searchWord, taskTime });
const { taskId, podName, source, nodeKind, logMode, pageNum, sort, limit, searchWord, taskTime, containerNames } = query;
const logs = await logsQueries.getLogs({ taskId, podName, source, nodeKind, logMode, pageNum, sort, limit, searchWord, taskTime, containerNames });
return logs;
}

Expand Down
33 changes: 22 additions & 11 deletions core/api-server/api/graphql/schemas/log-schema.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,29 @@
const { gql } = require('apollo-server');
const logsTypeDefs = gql`
type Logs {
level: String
timestamp: String
message: String
}
type Logs {
level: String
timestamp: String
message: String
}
type LogsMainType { logs: [Logs ],podStatus: String }
extend type Query {
logsByQuery(podName: String!,taskId:String,source:String,nodeKind:String,logMode:String,searchWord:String, taskTime:String, limit:Int): LogsMainType
}
type LogsMainType {
logs: [Logs]
podStatus: String
}
extend type Query {
logsByQuery(
podName: String!
taskId: String
source: String
nodeKind: String
logMode: String
searchWord: String
taskTime: String
limit: Int
containerNames: [String]
): LogsMainType
}
`;

module.exports = logsTypeDefs;
2 changes: 1 addition & 1 deletion core/api-server/api/rest-api/routes/v1/exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const routes = (options) => {
let datesRange;
let search;
let errormsg;
if (startTime !== undefined && startTime !== {}) {
if (startTime && Object.keys(startTime).length > 0) {
datesRange = { from: startTime.from, to: startTime.to };
search = { query: { jobId, pipelineName, datesRange } };
}
Expand Down
Loading

0 comments on commit ad81f66

Please sign in to comment.