Skip to content

Commit b84ad4b

Browse files
authored
Add support for Python 3.5 and 3.6 (#69)
* Update README.md and include Python versions
1 parent 6e1e2df commit b84ad4b

File tree

3 files changed

+78
-22
lines changed

3 files changed

+78
-22
lines changed

README.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
# Container Runtime Debugging Support (aka Duct Tape)
44

5-
_Caution: this is work-in-progress_
6-
75
This repository gathers additional dependencies required to debug
86
particular language runtimes with [`skaffold debug`](https://skaffold.dev/docs/how-tos/debug/).
97
These dependencies are packaged as a set of container images suitable
@@ -22,23 +20,29 @@ Current language runtimes:
2220
* `go`: provides [Delve](https://github.com/go-delve/delve)
2321
* `python`: provides [`ptvsd`](https://github.com/Microsoft/ptvsd),
2422
a debug adapter that can be used for VS Code and more, for
25-
Python 2.7 and 3.7
23+
Python 2.7 and 3.5+
24+
* `nodejs`: provides a `node` wrapper that propagates `--inspect`
25+
args to the application invokation
2626
* `netcore`: provides `vsdbg` for .NET Core
2727

2828
## Development
2929

30-
This directory includes a `skaffold.yaml` for development of the
31-
these `duct-tape` initContainer images. Each image is expected to
32-
be standalone and not require downloading content across the network.
33-
To add support for a new language runtime, an image definition
34-
should download the necessary files into the container image. The
35-
image's entrypoint should then copy those files into place at
36-
`/dbg/<runtime>`. The image should be added to the `skaffold.yaml`
37-
and referenced within `test/k8s-test-installation.yaml`.
30+
This project uses Skaffold's multiple config support to allow
31+
developing for each language runtime separately.
32+
33+
Each language runtime is broken out to a separate directory
34+
with a `skaffold.yaml` for development of the `duct-tape` initContainer
35+
image. Each image is expected to be standalone and not require
36+
downloading content across the network. To add support for a new
37+
language runtime, an image definition should download the necessary
38+
files into the container image. The image's entrypoint should then
39+
copy those files into place at `/dbg/<runtime>`. The image should
40+
be added to the respective `skaffold.yaml` and referenced within
41+
`test/k8s-*-installation.yaml`.
3842

39-
### Testing
43+
# Testing
4044

41-
Integration tests are found in `integration/`. These build and
45+
Integration tests are found in `test/`. These tests build and
4246
launch applications as pods that are similar to the transformed
4347
form produced by `skaffold debug`. To run:
4448

python/helper-image/Dockerfile

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414

1515
# This Dockerfile creates a debug helper base image for Python.
1616
# It provides installations of debugpy, ptvsd, pydevd, and pydevd-pycharm
17-
# for Python 2.7, 3.7, 3.8, and 3.9.
17+
# for Python 2.7, 3.5, 3.6, 3.7, 3.8, and 3.9.
18+
# - Apache Beam is based around Python 3.5
19+
# - Many ML/NLP images are based on Python 3.6
1820
#
1921
# debugpy and ptvsd are well-structured packages installed in separate
2022
# directories under # /dbg/python/lib/pythonX.Y/site-packages and
@@ -27,23 +29,33 @@
2729

2830
FROM python:2.7 as python27
2931
RUN PYTHONUSERBASE=/dbgpy pip install --user ptvsd debugpy
30-
RUN PYTHONUSERBASE=/dbgpy/pydevd/python2.7 pip install --user pydevd
31-
RUN PYTHONUSERBASE=/dbgpy/pydevd-pycharm/python2.7 pip install --user pydevd-pycharm
32+
RUN PYTHONUSERBASE=/dbgpy/pydevd/python2.7 pip install --user pydevd --no-warn-script-location
33+
RUN PYTHONUSERBASE=/dbgpy/pydevd-pycharm/python2.7 pip install --user pydevd-pycharm --no-warn-script-location
34+
35+
FROM python:3.5 as python35
36+
RUN PYTHONUSERBASE=/dbgpy pip install --user ptvsd debugpy
37+
RUN PYTHONUSERBASE=/dbgpy/pydevd/python3.5 pip install --user pydevd --no-warn-script-location
38+
RUN PYTHONUSERBASE=/dbgpy/pydevd-pycharm/python3.5 pip install --user pydevd-pycharm --no-warn-script-location
39+
40+
FROM python:3.6 as python36
41+
RUN PYTHONUSERBASE=/dbgpy pip install --user ptvsd debugpy
42+
RUN PYTHONUSERBASE=/dbgpy/pydevd/python3.6 pip install --user pydevd --no-warn-script-location
43+
RUN PYTHONUSERBASE=/dbgpy/pydevd-pycharm/python3.6 pip install --user pydevd-pycharm --no-warn-script-location
3244

3345
FROM python:3.7 as python37
3446
RUN PYTHONUSERBASE=/dbgpy pip install --user ptvsd debugpy
35-
RUN PYTHONUSERBASE=/dbgpy/pydevd/python3.7 pip install --user pydevd
36-
RUN PYTHONUSERBASE=/dbgpy/pydevd-pycharm/python3.7 pip install --user pydevd-pycharm
47+
RUN PYTHONUSERBASE=/dbgpy/pydevd/python3.7 pip install --user pydevd --no-warn-script-location
48+
RUN PYTHONUSERBASE=/dbgpy/pydevd-pycharm/python3.7 pip install --user pydevd-pycharm --no-warn-script-location
3749

3850
FROM python:3.8 as python38
3951
RUN PYTHONUSERBASE=/dbgpy pip install --user ptvsd debugpy
40-
RUN PYTHONUSERBASE=/dbgpy/pydevd/python3.8 pip install --user pydevd
41-
RUN PYTHONUSERBASE=/dbgpy/pydevd-pycharm/python3.8 pip install --user pydevd-pycharm
52+
RUN PYTHONUSERBASE=/dbgpy/pydevd/python3.8 pip install --user pydevd --no-warn-script-location
53+
RUN PYTHONUSERBASE=/dbgpy/pydevd-pycharm/python3.8 pip install --user pydevd-pycharm --no-warn-script-location
4254

4355
FROM python:3.9 as python39
4456
RUN PYTHONUSERBASE=/dbgpy pip install --user ptvsd debugpy
45-
RUN PYTHONUSERBASE=/dbgpy/pydevd/python3.9 pip install --user pydevd
46-
RUN PYTHONUSERBASE=/dbgpy/pydevd-pycharm/python3.9 pip install --user pydevd-pycharm
57+
RUN PYTHONUSERBASE=/dbgpy/pydevd/python3.9 pip install --user pydevd --no-warn-script-location
58+
RUN PYTHONUSERBASE=/dbgpy/pydevd-pycharm/python3.9 pip install --user pydevd-pycharm --no-warn-script-location
4759

4860
FROM golang:1.14.1 as build
4961
COPY launcher/ .
@@ -60,6 +72,8 @@ COPY install.sh /
6072
CMD ["/bin/sh", "/install.sh"]
6173
WORKDIR /duct-tape
6274
COPY --from=python27 /dbgpy/ python/
75+
COPY --from=python35 /dbgpy/ python/
76+
COPY --from=python36 /dbgpy/ python/
6377
COPY --from=python37 /dbgpy/ python/
6478
COPY --from=python38 /dbgpy/ python/
6579
COPY --from=python39 /dbgpy/ python/

python/structure-tests-python.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,56 @@ fileExistenceTests:
55
path: '/duct-tape/python/lib/python2.7/site-packages/ptvsd/__init__.py'
66
- name: 'debugpy for python 2.7'
77
path: '/duct-tape/python/lib/python2.7/site-packages/debugpy/__init__.py'
8+
- name: 'pydevd for python 2.7'
9+
path: '/duct-tape/python/pydevd/python2.7/lib/python2.7/site-packages/pydevd.py'
10+
- name: 'pydevd-pycharm for python 2.7'
11+
path: '/duct-tape/python/pydevd-pycharm/python2.7/lib/python2.7/site-packages/pydevd.py'
12+
13+
- name: 'ptvsd for python 3.5'
14+
path: '/duct-tape/python/lib/python3.5/site-packages/ptvsd/__init__.py'
15+
- name: 'debugpy for python 3.5'
16+
path: '/duct-tape/python/lib/python3.5/site-packages/debugpy/__init__.py'
17+
- name: 'pydevd for python 3.5'
18+
path: '/duct-tape/python/pydevd/python3.5/lib/python3.5/site-packages/pydevd.py'
19+
- name: 'pydevd-pycharm for python 3.5'
20+
path: '/duct-tape/python/pydevd-pycharm/python3.5/lib/python3.5/site-packages/pydevd.py'
21+
22+
- name: 'ptvsd for python 3.6'
23+
path: '/duct-tape/python/lib/python3.6/site-packages/ptvsd/__init__.py'
24+
- name: 'debugpy for python 3.6'
25+
path: '/duct-tape/python/lib/python3.6/site-packages/debugpy/__init__.py'
26+
- name: 'pydevd for python 3.6'
27+
path: '/duct-tape/python/pydevd/python3.6/lib/python3.6/site-packages/pydevd.py'
28+
- name: 'pydevd-pycharm for python 3.6'
29+
path: '/duct-tape/python/pydevd-pycharm/python3.6/lib/python3.6/site-packages/pydevd.py'
30+
831
- name: 'ptvsd for python 3.7'
932
path: '/duct-tape/python/lib/python3.7/site-packages/ptvsd/__init__.py'
1033
- name: 'debugpy for python 3.7'
1134
path: '/duct-tape/python/lib/python3.7/site-packages/debugpy/__init__.py'
35+
- name: 'pydevd for python 3.7'
36+
path: '/duct-tape/python/pydevd/python3.7/lib/python3.7/site-packages/pydevd.py'
37+
- name: 'pydevd-pycharm for python 3.7'
38+
path: '/duct-tape/python/pydevd-pycharm/python3.7/lib/python3.7/site-packages/pydevd.py'
39+
1240
- name: 'ptvsd for python 3.8'
1341
path: '/duct-tape/python/lib/python3.8/site-packages/ptvsd/__init__.py'
1442
- name: 'debugpy for python 3.8'
1543
path: '/duct-tape/python/lib/python3.8/site-packages/debugpy/__init__.py'
44+
- name: 'pydevd for python 3.8'
45+
path: '/duct-tape/python/pydevd/python3.8/lib/python3.8/site-packages/pydevd.py'
46+
- name: 'pydevd-pycharm for python 3.8'
47+
path: '/duct-tape/python/pydevd-pycharm/python3.8/lib/python3.8/site-packages/pydevd.py'
48+
1649
- name: 'ptvsd for python 3.9'
1750
path: '/duct-tape/python/lib/python3.9/site-packages/ptvsd/__init__.py'
1851
- name: 'debugpy for python 3.9'
1952
path: '/duct-tape/python/lib/python3.9/site-packages/debugpy/__init__.py'
53+
- name: 'pydevd for python 3.9'
54+
path: '/duct-tape/python/pydevd/python3.9/lib/python3.9/site-packages/pydevd.py'
55+
- name: 'pydevd-pycharm for python 3.9'
56+
path: '/duct-tape/python/pydevd-pycharm/python3.9/lib/python3.9/site-packages/pydevd.py'
57+
2058
- name: 'python launcher'
2159
path: '/duct-tape/python/launcher'
2260
isExecutableBy: any

0 commit comments

Comments
 (0)