Skip to main content

Dockipy

PyPI - Version PyPI - Python Version

Table of Contents


Installation

pip install dockipy

For remote access to hosts

sudo apt install tmux openssh-client 

make sure you have ssh keys setup for the remote hosts.

ssh-keygen 

ssh-copy-id username@host

What is dockipy?

dockipy is your ticket to productivity paradise, a simple yet mighty wrapper around the Docker command line interface. It's the friend who says, "Don't worry about the nitty-gritty, I got you!" Just lean back and let dockipy work its magic, it will mount you project in a container seamlessly. If it doesn't break then everything should be fine.

And here's the cherry on top: with dockipy, you can dive into a Python virtual environment inside your container. It's like a containerception—codeception—whatever you want to call it! Run your code with the ease, all thanks to dockipy.

But wait, there's a catch! Before you sail into the dockipy, make sure you have Docker installed. And if you're planning to use NVIDIA GPUs, brace yourself! Docker GPU driver installation is a mess, dockipy won't hold your hand through that chaos—consider yourself warned!

How to Use dockipy

Ready to embark on your container adventure? Here's how dockipy can make your coding dreams come true:

Run Your Code: Use dockipy to run your code in a container inside a Python virtual environment within another container. It's like Inception, but for coding!

dockipy my_script.py

How to Use dockishell

Need to run an arbitrary command in a container? No problem! Just fire up dockishell and let the container magic begin.

dockishell nvidia-smi

How to Use dockibook

Want to unleash the power of Jupyter Notebooks in a container? Say no more! Use dockibook and open the link in your browser, colab or visual studio code.

dockibook .

Don't want to use Docker but still would like to use the configuration? No problem! Use envipy and envibook to run your code and notebooks in a virtual environment.

Since Windows is such a messy work with rawdogging your environment is totally okay.

envipy my_script.py
envibook .

Configure environment

Tired of Docker feeling like a high-maintenance diva? Set up your environment like a pro with docki.yaml. No more Docker dramas, just smooth sailing.

docki --init

docki.yaml

This file is used to specify the base image, system dependencies, and python dependencies for the Docker container. If the file does not exist, a template will be created in the project root using docki --init.

base_image: The base image for the Docker container. You can find images on Docker Hub.

system_dep: A list of system dependencies to install in the Docker container. Install with apt-get.

python_dep: A list of python dependencies to install in the Docker container or a path to a requirements.txt file.

base_image: nvidia/cuda:11.8.0-devel-ubuntu22.04 # base image for the container can find more on Docker Hub
shm_size: 16G # shared memory size
tag: docki # name of the container
system_dep: # list of system dependencies to install during the build
  - python3
  - python3-pip
  - python3-dev
  - python3-venv
system_commands: # list of system commands to run after installing system dependencies during the build
    - apt-get update
python_dep: # list or file of python dependencies to install
  file: ./requirements.txt
init_commands: # this will be run before as initial as you start the container
    - export ENV_VAR=VALUE
remote:
  hosts:
    - name: username@host1
    - name: username@host2
      workspace: /path/to/workspace

Remote access to Hosts

You can add remote hosts to the docki.yaml file. This will allow you to run the container on a remote host. The workspace is the path to the project on the remote host.

remote:
  hosts:
    - name: username@host1
    - name: username@host2
      workspace: /path/to/workspace

How to run the container on a remote host

dockipy --remote 
## Is something went wrong? 

You can stop or kill the container with the following commands. It will use the tag from the docki.yaml file to stop or kill the container.

```bash
dockikill
dockistop

But this is not happening often, right? 🤞

TODO

  • Add support Windows Notebooks
  • Add support for Docker GPU driver installation on WLS2
  • Add support for Mac. I don't have a Mac! Pls send donations to my onlyfans so that i can afford one!

License

dockipy is like that cool friend who always lets you borrow their stuff without any fuss. It's distributed under the terms of the apache-2.0 license. So go ahead, have some fun with it! 🎉

Metadata

Release files for dockipy 0.0.92

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dockipy 0.0.92
File Size Uploaded
dockipy-0.0.92.tar.gz 15.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dockipy 0.0.92
File Interpreter ABI Platform
dockipy-0.0.92-py3-none-any.whl Python 3 none any Details

Total release size: 33.3 kB

Release files / dockipy-0.0.92.tar.gz

Download URL dockipy-0.0.92.tar.gz
Size 15.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f7b7ac67113d10a181a3a4ccc0e18befcbfe07d3905c93ad0abb744d302fcba3
BLAKE2b-256 checksum
How to use checksums
e729dbd50edc6dfea66be2485a4d9b7cc357401067cbb9f489f3c1eba8c568e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.28.1

Release files / dockipy-0.0.92-py3-none-any.whl

Download URL dockipy-0.0.92-py3-none-any.whl
Size 18.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3ab53eb622a29973f6dad5071d4300f5c9bc249fe9afd69f69c47f91b6785331
BLAKE2b-256 checksum
How to use checksums
497f4d651ae1ff6f04f3c9b55efb31085b72ce515ab9940d77e0466ed41dcc01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.28.1

Release history Release notifications | RSS feed

This release

0.0.92 This release

2 release files

0.0.91

2 release files

0.0.90

2 release files

0.0.89

2 release files

0.0.88

2 release files

0.0.87

2 release files

0.0.86

2 release files

0.0.85

2 release files

0.0.84

2 release files

0.0.83

2 release files

0.0.82

2 release files

0.0.81

2 release files

0.0.80

2 release files

0.0.79

2 release files

0.0.65

2 release files

0.0.64

2 release files

0.0.63

2 release files

0.0.62

2 release files

0.0.61

2 release files

0.0.60

2 release files

0.0.59

2 release files

0.0.58

2 release files

0.0.57

2 release files

0.0.56

2 release files

0.0.55

2 release files

0.0.54

2 release files

0.0.53

2 release files

0.0.52

2 release files

0.0.51

2 release files

0.0.50

2 release files

0.0.49

2 release files

0.0.48

2 release files

0.0.47

2 release files

0.0.46

2 release files

0.0.45

2 release files

0.0.44

2 release files

0.0.43

2 release files

0.0.42

2 release files

0.0.41

2 release files

0.0.40

2 release files

0.0.39

2 release files

0.0.38

2 release files

0.0.37

2 release files

0.0.36

2 release files

0.0.35

2 release files

0.0.34

2 release files

0.0.33

2 release files

0.0.32

2 release files

0.0.31

2 release files

0.0.30

2 release files

0.0.29

2 release files

0.0.28

2 release files

0.0.27

2 release files

0.0.26

2 release files

0.0.25

2 release files

0.0.24

2 release files

0.0.23

2 release files

0.0.22

2 release files

0.0.21

2 release files

0.0.20

2 release files

0.0.19

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page