This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
result | start_position | date | circuit | name | constructor | |
---|---|---|---|---|---|---|
1.0 | 1.0 | 2008-03-16 | Albert Park Grand Prix Circuit | Lewis Hamilton | McLaren | |
2.0 | 5.0 | 2008-03-16 | Albert Park Grand Prix Circuit | Nick Heidfeld | BMW Sauber | |
3.0 | 7.0 | 2008-03-16 | Albert Park Grand Prix Circuit | Nico Rosberg | Williams | |
4.0 | 12.0 | 2008-03-16 | Albert Park Grand Prix Circuit | Fernando Alonso | Renault | |
5.0 | 3.0 | 2008-03-16 | Albert Park Grand Prix Circuit | Heikki Kovalainen | McLaren |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.8.7-alpine | |
RUN pip install --upgrade pip | |
RUN pip install pipenv | |
RUN adduser -D python | |
# Create the work dir and set permissions as WORKDIR set the permissions as root | |
RUN mkdir /home/python/app/ && chown -R python:python /home/python/app | |
WORKDIR /home/python/app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Column Name | Data Type | Constraints | |
---|---|---|---|
id | INTEGER | UNIQUE | |
scan_id | INTEGER | UNIQUE | |
created | TEXT | ||
updated | TEXT | ||
progress | INTEGER | ||
high_alerts | INTEGER | ||
medium_alerts | INTEGER | ||
low_alerts | INTEGER | ||
info_alerts | INTEGER |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// dependencies | |
const fs = require('fs'); | |
const log = require('../log'); | |
const dockerSecret = {}; | |
dockerSecret.read = function read(secretNameAndPath) { | |
try { | |
return fs.readFileSync(`${secretNameAndPath}`, 'utf8'); | |
} catch(err) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resources: | |
requests: | |
cpu: 1500m | |
memory: 1024Mi | |
limits: | |
cpu: 8000m | |
memory: 2524Mi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (encodingInstructions.videoEncoder === constants.ENCODER_TYPES.X265) { | |
const ffmpegCommand = ffmpeg() | |
.input(inputAsset) | |
.videoBitrate(encodingInstructions.videoBitrate) | |
.videoCodec(encodingInstructions.videoEncoder) | |
.size(encodingInstructions.videoSize) | |
.audioCodec(encodingInstructions.audioEncoder) | |
.audioBitrate(encodingInstructions.audioBitrate) | |
.audioFrequency(encodingInstructions.audioFrequency) | |
.withOutputOptions('-force_key_frames "expr:gte(t,n_forced*2)"') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.processEncodingTasks = function processEncodingTasks() { | |
encoderEngine.searchTasks((searchErr, encoderInstructions) => { | |
if (!searchErr && encoderInstructions) { | |
log.info(`Got encoder instructions, started encoder for task '${encoderInstructions.name}' id:${encoderInstructions._id}`); | |
encoderEngine.startEncoder(encoderInstructions, (startErr) => { | |
if (!startErr) { | |
encoderEngine.setTaskToFinished(encoderInstructions._id, (finishErr) => { | |
if (finishErr) { | |
log.error(`An error occurred while trying to set the task to finished. ${finishErr.message}`); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scalingEngine.getNumberOfNeededEncoders = (numberOfEncodingTasks, numberOfEncoders) => { | |
if (numberOfEncodingTasks >= 0 && numberOfEncodingTasks <= 10) { | |
if (numberOfEncoders >= 1 && numberOfEncodingTasks < 1) { | |
return 0; | |
} | |
return numberOfEncoders; | |
} | |
if (numberOfEncodingTasks > 10 && numberOfEncodingTasks <= 50) { | |
if (numberOfEncoders < 4) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: encoderscaler | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: encoderscaler | |
strategy: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import k8s from '@kubernetes/client-node'; | |
import log from './log.js'; | |
const kubernetesClient = {}; | |
kubernetesClient.setNumberOfEncoders = async (numberOfEncoders) => { | |
try { | |
const kubeconfig = new k8s.KubeConfig(); | |
if (process.env.NODE_ENV === 'production') { |
NewerOlder