Compare commits
2 Commits
Author | SHA1 | Date |
---|---|---|
Jeffrey Paul | 4fd6a60402 | |
Jeffrey Paul | c188616917 |
1
Pipfile
1
Pipfile
|
@ -7,6 +7,7 @@ verify_ssl = true
|
|||
|
||||
[packages]
|
||||
sanelogging = "*"
|
||||
sentry-sdk = "==0.10.2"
|
||||
|
||||
[requires]
|
||||
python_version = "3.6"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"_meta": {
|
||||
"hash": {
|
||||
"sha256": "d189f59cdb9acb7b516c87ead0bf88b4ebc5d7057caf2f46d4cb25e25b317035"
|
||||
"sha256": "b2b160ff8a634b8c3542e2f350c55373f3090b7fccba55a8f8fcbec87ad9c3aa"
|
||||
},
|
||||
"pipfile-spec": 6,
|
||||
"requires": {
|
||||
|
@ -16,6 +16,13 @@
|
|||
]
|
||||
},
|
||||
"default": {
|
||||
"certifi": {
|
||||
"hashes": [
|
||||
"sha256:046832c04d4e752f37383b628bc601a7ea7211496b4638f6514d0e5b9acc4939",
|
||||
"sha256:945e3ba63a0b9f577b1395204e13c3a231f9bc0223888be653286534e5873695"
|
||||
],
|
||||
"version": "==2019.6.16"
|
||||
},
|
||||
"colorlog": {
|
||||
"hashes": [
|
||||
"sha256:3cf31b25cbc8f86ec01fef582ef3b840950dea414084ed19ab922c8b493f9b42",
|
||||
|
@ -29,6 +36,21 @@
|
|||
],
|
||||
"index": "pypi",
|
||||
"version": "==1.0.1"
|
||||
},
|
||||
"sentry-sdk": {
|
||||
"hashes": [
|
||||
"sha256:d491aa6399eaa3eded433972751a9770180730fd8b4c225b0b7f49c4fa2af70b",
|
||||
"sha256:d68003cdffbbfcadaa2c445b72e1050b0a44406f94199866f192986c016b23f5"
|
||||
],
|
||||
"index": "pypi",
|
||||
"version": "==0.10.2"
|
||||
},
|
||||
"urllib3": {
|
||||
"hashes": [
|
||||
"sha256:b246607a25ac80bedac05c6f282e3cdaf3afb65420fd024ac94435cabe6e18d1",
|
||||
"sha256:dbe59173209418ae49d485b87d1681aefa36252ee85884c31346debd19463232"
|
||||
],
|
||||
"version": "==1.25.3"
|
||||
}
|
||||
},
|
||||
"develop": {}
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
#234567891123456789212345678931234567894123456789512345678961234567897123456789
|
||||
# encoding: utf-8
|
||||
|
||||
from .rpc import STRpcRunnerService
|
||||
from .server import STRpcRunnerService
|
||||
|
|
|
@ -2,21 +2,24 @@
|
|||
#234567891123456789212345678931234567894123456789512345678961234567897123456789
|
||||
# encoding: utf-8
|
||||
|
||||
|
||||
from .job import STRpcJob
|
||||
from .utils import *
|
||||
from datetime import datetime, tzinfo, timedelta
|
||||
from sanelogging import log
|
||||
from time import sleep
|
||||
import json
|
||||
import os
|
||||
import pathlib
|
||||
import sentry_sdk
|
||||
import socket
|
||||
import subprocess
|
||||
import uuid
|
||||
from .job import STRpcJob
|
||||
from .utils import *
|
||||
|
||||
class STRpcRunnerService(object):
|
||||
|
||||
def __init__(self):
|
||||
sentry_sdk.init("https://598ba2b22ae947328590765e31e29a82@sentry.io/1525291")
|
||||
self.dir = os.environ.get('STRPC_BASE','/var/run/strpc')
|
||||
self.hostname = socket.gethostname()
|
||||
self.hostdir = self.dir + '/' + self.hostname
|
||||
|
@ -26,15 +29,21 @@ class STRpcRunnerService(object):
|
|||
self.jobs = []
|
||||
self.running = True
|
||||
self.dockerpath = None
|
||||
|
||||
log.info("strpcd starting up on %s" % self.hostname)
|
||||
|
||||
|
||||
log.info("strpcd starting up on %s out of directory %s" % (
|
||||
self.hostname, self.dir)
|
||||
)
|
||||
|
||||
if not os.path.isdir(self.dir):
|
||||
raise Exception("STRPC base directory not found")
|
||||
self.setup()
|
||||
|
||||
def setup(self):
|
||||
log.info("creating dir %s if not exist" % self.hostdir)
|
||||
pathlib.Path(self.hostdir).mkdir(parents=True, exist_ok=True)
|
||||
log.info("creating dir %s if not exist" % self.jobdir)
|
||||
pathlib.Path(self.jobdir).mkdir(parents=True, exist_ok=True)
|
||||
log.info("creating dir %s if not exist" % self.logdir)
|
||||
pathlib.Path(self.logdir).mkdir(parents=True, exist_ok=True)
|
||||
self.write_status_file()
|
||||
|
Loading…
Reference in New Issue