Comments (4)
Please refer to the web procfile for initial restrictions
from workflow.
design
drycc run
to asynchronous execution, use job.drycc run
returns pod_name, add timeout parameter.drycc ps:logs
can view pod logs
> drycc run -t 3600 echo 111
appname-run-a91321-adf141
> drycc ps:logs appname-run-a91321-adf141
111
job structure
{
"apiVersion":"batch/v1",
"kind":"Job",
"metadata":{
"name":"appname-run"
},
"spec":{
"template":{
"spec":{
"containers":[
{
"name":"appname-run",
"image":"127.0.0.1:5555/appname/appname:v3",
"command":[
"echo",
"111"
]
}
],
"restartPolicy":"Never"
}
},
"backoffLimit":0,
"activeDeadlineSeconds":3600,
"ttlSecondsAfterFinished":86400
}
}
from workflow.
K8s pod logs code snippet:
import asyncio
from kubernetes import config
from kubernetes.client import Configuration
from kubernetes.client.api import core_v1_api
from asgiref.sync import sync_to_async, async_to_sync
async def send(line):
print(line)
@sync_to_async
def exec_commands(api_instance):
kwargs = {"tail_lines": 10, "follow": True, "_preload_content": False, "container": ""}
stream = api_instance.read_namespaced_pod_log(
'drycc-timeseries-main-0', 'drycc', **kwargs
).stream()
for line in stream:
async_to_sync(send)(line=line)
def main():
config.load_kube_config()
try:
c = Configuration().get_default_copy()
except AttributeError:
c = Configuration()
c.assert_hostname = False
Configuration.set_default(c)
core_v1 = core_v1_api.CoreV1Api()
loop = asyncio.get_event_loop()
loop.run_until_complete(exec_commands(core_v1))
if __name__ == '__main__':
main()
from workflow.
complete
from workflow.
Related Issues (10)
- drycc.yaml support HOT 2
- use Dockerfile entrypoint HOT 1
- Add diagnostic mode for all chars HOT 2
- Reuse cm and secrets when upgrading
- add volumes:client support HOT 1
- [controller] drop ndg_httpsclient require
- [controller] use cryptography replace pyOpenSSL
- Delete canary feature HOT 1
- add ptype command HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from workflow.