-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathexample.py
More file actions
executable file
·37 lines (29 loc) · 955 Bytes
/
example.py
File metadata and controls
executable file
·37 lines (29 loc) · 955 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/python
from metaparticle_pkg import Containerize, PackageFile
import os
import time
import logging
# all metaparticle output is accessible through the stdlib logger (debug level)
logging.basicConfig(level=logging.INFO)
logging.getLogger('metaparticle_pkg.runner').setLevel(logging.DEBUG)
logging.getLogger('metaparticle_pkg.builder').setLevel(logging.DEBUG)
DATA_FILE = '/opt/some/random/spot/data1.json'
SCRIPT = '/opt/another/random/place/get_the_data.sh'
@Containerize(
package={
'name': 'file-example',
'repository': 'docker.io/brendanburns',
'publish': False,
'additionalFiles': [
PackageFile(src='./data.json', dest=DATA_FILE, mode='0400'),
PackageFile(src='./get_data.sh', dest=SCRIPT),
]
}
)
def main():
os.system(SCRIPT)
for i in range(5):
print('Sleeping ... {} sec'.format(i))
time.sleep(1)
if __name__ == '__main__':
main()