Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuxel committed Apr 23, 2019
2 parents 15478e8 + 220ada3 commit 3597d6d
Show file tree
Hide file tree
Showing 13 changed files with 211 additions and 55 deletions.
4 changes: 2 additions & 2 deletions containers/python-2/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File (Integrated Terminal)",
"name": "Python (Integrated Terminal)",
"type": "python",
"request": "launch",
"program": "${file}",
"program": "${workspaceFolder}/test-project/hello.py",
"console": "integratedTerminal"
}
]
Expand Down
42 changes: 36 additions & 6 deletions containers/python-2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,50 @@

| Metadata | Value |
|----------|-------|
| *Contributors* | The VS Code Team |
| *Contributors* | The [VS Code Python extension](https://marketplace.visualstudio.com/itemdetails?itemName=ms-python.python) team |
| *Definition type* | Dockerfile |
| *Languages, platforms* | Python |

## Usage
## Using this definition with an existing folder

[See here for information on using this definition with an existing project](https://aka.ms/vscode-remote/containers/getting-started/open).
For convenience, this definition will automatically install dependencies from your `requirements.txt` file when the container is built. Also note that only the integrated terminal is supported by the Remote - Containers extension. You may need to modify `launch.json` configurations to include the following value if an external console is used.

If you prefer, you can also just look through the contents of the `.devcontainer` folder to understand how to make changes to your own project.
```json
"console": "integratedTerminal"
```

If you want to try out the test project instead, run **Remote-Container: Open Folder in Container...** in VS Code and select a cloned copy of the entire folder. You can then start the test program from Debug panel in VS Code.
Beyond that, just follow these steps:

1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine.

2. To use VS Code's copy of this definition:
1. Start VS Code and open your project folder.
2. Press <kbd>F1</kbd> select and **Remote-Containers: Create Container Configuration File...** from the command palette.
3. Select the Python 2 definition.

3. To use latest-and-greatest copy of this definition from the repository:
1. Clone this repository.
2. Copy the contents of `containers/python-2/.devcontainer` to the root of your project folder.
3. Start VS Code and open your project folder.

4. After following step 2 or 3, the contents of the `.devcontainer` folder in your project can be adapted to meet your needs.

5. Finally, press <kbd>F1</kbd> and run **Remote-Containers: Reopen Folder in Container** to start using the definition.

## Testing the definition

This definition includes some test code that will help you verify it is working as expected on your system. Follow these steps:

1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine.
2. Clone this repository.
3. Start VS Code, press <kbd>F1</kbd>, and select **Remote-Containers: Open Folder in Container...**
4. Select the `containers/python-2` folder.
5. After the folder has opened in the container, press <kbd>F5</kbd> to start the project.
6. You should see "Hello, remote world!" in a terminal window after the program executes.
7. From here, you can add breakpoints or edit the contents of the `test-project` folder to do further testing.

## License

Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE).
Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE)
5 changes: 3 additions & 2 deletions containers/python-3-anaconda/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File (Integrated Terminal)",
"name": "Python (Integrated Terminal)",
"type": "python",
"request": "launch",
"program": "${file}",
"program": "${workspaceFolder}/test-project/hello.py",
"cwd":"${workspaceFolder}/test-project",
"console": "integratedTerminal"
}
]
Expand Down
44 changes: 37 additions & 7 deletions containers/python-3-anaconda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,52 @@

| Metadata | Value |
|----------|-------|
| *Contributors* | The VS Code Team |
| *Contributors* | The [VS Code Python extension](https://marketplace.visualstudio.com/itemdetails?itemName=ms-python.python) team |
| *Definition type* | Dockerfile |
| *Languages, platforms* | Python |

## Usage
## Using this definition with an existing folder

[See here for information on using this definition with an existing project](https://aka.ms/vscode-remote/containers/getting-started/open).
For convenience, this definition will automatically install dependencies from your `requirements.txt` file when the container is built. Also note that only the integrated terminal is supported by the Remote - Containers extension. You may need to modify `launch.json` configurations to include the following value if an external console is used.

If you prefer, you can also just look through the contents of the `.devcontainer` folder to understand how to make changes to your own project.
```json
"console": "integratedTerminal"
```

If you want to try out the test project instead, run **Remote-Container: Open Folder in Container...** in VS Code and select a cloned copy of the entire folder.
Beyond that, just follow these steps:

Then, open test-project/hello.py and press shift-enter to run the cell and see the interactive matplotlib output.
1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine.

2. To use VS Code's copy of this definition:
1. Start VS Code and open your project folder.
2. Press <kbd>F1</kbd> select and **Remote-Containers: Create Container Configuration File...** from the command palette.
3. Select the Python 3 - Anaconda definition.

3. To use latest-and-greatest copy of this definition from the repository:
1. Clone this repository.
2. Copy the contents of `containers/python-3-anaconda/.devcontainer` to the root of your project folder.
3. Start VS Code and open your project folder.

4. After following step 2 or 3, the contents of the `.devcontainer` folder in your project can be adapted to meet your needs.

5. Finally, press <kbd>F1</kbd> and run **Remote-Containers: Reopen Folder in Container** to start using the definition.

## Testing the definition

This definition includes some test code that will help you verify it is working as expected on your system. Follow these steps:

1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine.
2. Clone this repository.
3. Start VS Code, press <kbd>F1</kbd>, and select **Remote-Containers: Open Folder in Container...**
4. Select the `containers/python-3-anaconda` folder.
5. After the folder has opened in the container, press <kbd>F5</kbd> to start the project.
6. A `test-project/plot.png` file should be added to the folder after it runs with the plot result.
7. Next, open `test-project/hello.py` and press <kbd>ctrl/cmd</kbd>+<kbd>a</kbd> then <kbd>shift</kbd>+<kbd>enter</kbd>.
8. You should see the `matplotlib` output in the interactive window.
9. From here, you can add breakpoints or edit the contents of the `test-project` folder to do further testing.

## License

Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE).
Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE)
1 change: 1 addition & 0 deletions containers/python-3-anaconda/test-project/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
plot.png
6 changes: 4 additions & 2 deletions containers/python-3-anaconda/test-project/hello.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@
title='About as simple as it gets, folks')
ax.grid()

fig.savefig("test.png")
plt.show()
fig.savefig("plot.png")
plt.show()

print('Open test-project/plot.png to see the result!')
5 changes: 3 additions & 2 deletions containers/python-3-miniconda/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File (Integrated Terminal)",
"name": "Python (Integrated Terminal)",
"type": "python",
"request": "launch",
"program": "${file}",
"program": "${workspaceFolder}/test-project/hello.py",
"cwd":"${workspaceFolder}/test-project",
"console": "integratedTerminal"
}
]
Expand Down
46 changes: 39 additions & 7 deletions containers/python-3-miniconda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,54 @@

| Metadata | Value |
|----------|-------|
| *Contributors* | The VS Code Team |
| *Contributors* | The [VS Code Python extension](https://marketplace.visualstudio.com/itemdetails?itemName=ms-python.python) team |
| *Definition type* | Dockerfile |
| *Languages, platforms* | Python |

## Usage
## Using this definition with an existing folder

[See here for information on using this definition with an existing project](https://aka.ms/vscode-remote/containers/getting-started/open).
First, for convenience, this definition will automatically install dependencies from your `environment.yml` file when the container is built. However, note that `environment.yml` in the root of this definition folder is **only present for testing** and is not used or required by the definition itself.

If you prefer, you can also just look through the contents of the `.devcontainer` folder to understand how to make changes to your own project.
Second, only the integrated terminal is supported by the Remote - Containers extension. You may need to modify `launch.json` configurations to include the following value if an external console is used.

If you want to try out the test project instead, run **Remote-Container: Open Folder in Container...** in VS Code and select a cloned copy of the entire folder.
```json
"console": "integratedTerminal"
```

Then, open test-project/hello.py and press shift-enter to run the cell and see the interactive matplotlib output.
Beyond that, just follow these steps:

1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine.

2. To use VS Code's copy of this definition:
1. Start VS Code and open your project folder.
2. Press <kbd>F1</kbd> select and **Remote-Containers: Create Container Configuration File...** from the command palette.
3. Select the Python 3 - Miniconda definition.

3. To use latest-and-greatest copy of this definition from the repository:
1. Clone this repository.
2. Copy the contents of `containers/python-3-miniconda/.devcontainer` to the root of your project folder.
3. Start VS Code and open your project folder.

4. After following step 2 or 3, the *only* the contents of the `.devcontainer` folder in your project can be adapted to meet your needs. Ignore other files and folders.

5. Finally, press <kbd>F1</kbd> and run **Remote-Containers: Reopen Folder in Container** to start using the definition.

## Testing the definition

This definition includes some test code that will help you verify it is working as expected on your system. Follow these steps:

1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine.
2. Clone this repository.
3. Start VS Code, press <kbd>F1</kbd>, and select **Remote-Containers: Open Folder in Container...**
4. Select the `containers/python-3-miniconda` folder.
5. After the folder has opened in the container, press <kbd>F5</kbd> to start the project.
6. A `test-project/plot.png` file should be added to the folder after it runs with the plot result.
7. Next, open `test-project/hello.py` and press <kbd>ctrl/cmd</kbd>+<kbd>a</kbd> then <kbd>shift</kbd>+<kbd>enter</kbd>.
8. You should see the `matplotlib` output in the interactive window.
9. From here, you can add breakpoints or edit the contents of the `test-project` folder to do further testing.

## License

Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE).
Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE)
1 change: 1 addition & 0 deletions containers/python-3-miniconda/test-project/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
plot.png
6 changes: 4 additions & 2 deletions containers/python-3-miniconda/test-project/hello.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@
title='About as simple as it gets, folks')
ax.grid()

fig.savefig("test.png")
plt.show()
fig.savefig("plot.png")
plt.show()

print('Open test-project/plot.png to see the result!')
60 changes: 43 additions & 17 deletions containers/python-3-postgres/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,60 @@

| Metadata | Value |
|----------|-------|
| *Contributors* | The VS Code Team |
| *Contributors* | The [VS Code Python extension](https://marketplace.visualstudio.com/itemdetails?itemName=ms-python.python) team |
| *Definition type* | Dockerfile |
| *Languages, platforms* | Python |

## Usage
## Using this definition with an existing folder

[See here for information on using this definition with an existing project](https://aka.ms/vscode-remote/containers/getting-started/open).
First, for convenience, this definition will automatically install dependencies from your `requirements.txt` file when the container is built. However, note that `requirements.txt` in the root of this definition folder is **only present for testing** and is not used or required by the definition itself.

If you prefer, you can also just look through the contents of the `.devcontainer` folder to understand how to make changes to your own project.
Second, only the integrated terminal is supported by the Remote - Containers extension. You may need to modify `launch.json` configurations to include the following value if an external console is used.

If you want to try out the test project instead, run **Remote-Container: Open Folder in Container...** in VS Code and select a cloned copy of the entire folder.

Initialize the database and super user by opening the terminal and running:
```
cd test-project
python manage.py migrate
python manage.py createsuperuser
```json
"console": "integratedTerminal"
```

You can then start the test program from Debug panel in VS Code, or by running:
```
python manage.py runserver 0.0.0.0:5000
```
Beyond that, just follow these steps:

1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine.

2. To use VS Code's copy of this definition:
1. Start VS Code and open your project folder.
2. Press <kbd>F1</kbd> select and **Remote-Containers: Create Container Configuration File...** from the command palette.
3. Select the Python 3 & PostgreSQL definition.

3. To use latest-and-greatest copy of this definition from the repository:
1. Clone this repository.
2. Copy the contents of `containers/python-3-postgres/.devcontainer` to the root of your project folder.
3. Start VS Code and open your project folder.

4. After following step 2 or 3, the *only* the contents of the `.devcontainer` folder in your project can be adapted to meet your needs. Ignore other files and folders.

5. Finally, press <kbd>F1</kbd> and run **Remote-Containers: Reopen Folder in Container** to start using the definition.

## Testing the definition

This definition includes some test code that will help you verify it is working as expected on your system. Follow these steps:

Then browse to [http://localhost:5000/admin](http://localhost:5000/admin) and login!
1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine.
2. Clone this repository.
3. Start VS Code, press <kbd>F1</kbd>, and select **Remote-Containers: Open Folder in Container...**
4. Select the `containers/python-3-postgres` folder.
5. After the folder has opened in the container, use <kbd>ctrl</kbd>+<kbd>shift</kbd>+<kbd>`</kbd> to open a terminal and run the following commands to initialize the database and create a super user:
```bash
cd test-project
python manage.py migrate
python manage.py createsuperuser
```
6. Next, press <kbd>F5</kbd> to start the project.
7. Once the project is running, press <kbd>F1</kbd> and select **Remote-Containers: Forward Port...**
8. Select port 5000 and click the "Open Browser" button in the notification that appears.
9. You should see a page with a message indicating the install was successful. You can also go to `http://localhost:<port>/admin` and sign in.
10. From here, you can add breakpoints or edit the contents of the `test-project` folder to do further testing.

## License

Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE).
Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE)
4 changes: 2 additions & 2 deletions containers/python-3/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File (Integrated Terminal)",
"name": "Python (Integrated Terminal)",
"type": "python",
"request": "launch",
"program": "${file}",
"program": "${workspaceFolder}/test-project/hello.py",
"console": "integratedTerminal"
}
]
Expand Down
Loading

0 comments on commit 3597d6d

Please sign in to comment.