FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
docker-lambda/base/dump-python38.py at master · forward3d/docker-lambda · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
forward3d
/
docker-lambda
Public
forked from
lambci/docker-lambda
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
5
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
docker-lambda
/
base
/
dump-python38.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
43 lines (31 loc) · 1.46 KB
Breadcrumbs
docker-lambda
/
base
/
dump-python38.py
Copy path
File metadata and controls
43 lines (31 loc) · 1.46 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
38
39
40
41
42
43
from
__future__
import
print_function
import
os
import
sys
import
subprocess
import
json
import
boto3
from
boto3
.
s3
.
transfer
import
S3Transfer
TRANSFER
=
S3Transfer
(
boto3
.
client
(
's3'
))
def
lambda_handler
(
event
,
context
):
if
'cmd'
in
event
:
return
print
(
subprocess
.
check_output
([
'sh'
,
'-c'
,
event
[
'cmd'
]]).
decode
(
'utf-8'
))
filename
=
'python3.8.tgz'
subprocess
.
call
([
'sh'
,
'-c'
,
f'tar -cpzf /tmp/
{
filename
}
--numeric-owner --ignore-failed-read '
+
'/var/runtime /var/lang /var/rapid'
])
print
(
'Zipping done! Uploading...'
)
TRANSFER
.
upload_file
(
f'/tmp/
{
filename
}
'
,
'lambci'
,
f'fs/
{
filename
}
'
,
extra_args
=
{
'ACL'
:
'public-read'
})
print
(
'Uploading done!'
)
info
=
{
'sys.executable'
:
sys
.
executable
,
'sys.argv'
:
sys
.
argv
,
'sys.path'
:
sys
.
path
,
'os.getcwd'
:
os
.
getcwd
(),
'__file__'
:
__file__
,
'os.environ'
: {
k
:
str
(
v
)
for
k
,
v
in
os
.
environ
.
items
()},
'context'
: {
k
:
str
(
v
)
for
k
,
v
in
context
.
__dict__
.
items
()},
'proc environ'
:
subprocess
.
check_output
(
[
'sh'
,
'-c'
,
'echo /proc/1/environ; xargs -n 1 -0 < /proc/1/environ'
]).
decode
(
'utf-8'
).
splitlines
(),
'ps aux'
:
subprocess
.
check_output
(
[
'bash'
,
'-O'
,
'extglob'
,
'-c'
,
'for cmd in /proc/+([0-9])/cmdline; do echo $cmd; xargs -n 1 -0 < $cmd; done'
]).
decode
(
'utf-8'
).
splitlines
()}
print
(
json
.
dumps
(
info
,
indent
=
2
))
return
info
Back
|
FazBrowse Home
|
New Git URL