Skip to main content

VKube-CLI User-End

Project description

Vkube Command Tool For User

Install && Use

pip install vkube
vkube config -w GHCRToken/DockerhubToken=xxx
vkube deploy -f xxx/VKubefile.yaml

Run CLI Locally

Install virtualenv to run the CLI tool locally:

pip3 install virtualenv

Create virtual environment:

cd vkube-cli && virtualenv venv

Activate virtual environment:

source venv/bin/activate

Install CLI:

pip install -e .
vkube deploy -f xxx.yaml
vkube config -w GHCRToken=xxx

Deactivate virtual environment:

deactivate

Install CLI Globally from Source Code

Navigate to the repository root:

cd /path_to_project #directory containing setup.py
pip3 install -e . # may need to manually create ~/.vkube/config.yaml

or

pip3 install . # auto generates ~/.vkube/config.yaml

Install CLI with isolated dependencies:

pip3 install --user pipx
export PATH="$HOME/.local/bin:$PATH"
pipx install ~/path_to_project
pipx install --editable ~/path_to_project

Using vkube-cli

After installing locally, from the root path ("xxx/vkube-cli"):

  1. Add DockerhubToken or GHCRToken:
vkube config -w DockerhubToken=dckr_pat_xxxx
vkube config -w GHCRToken=ghcr_xxx

2.Configure VKubefile.yaml

3.Deploy using:

vkube deploy -f ./VKubefile.yaml #can deploy from any directory by specifying VKubefile.yaml path

Export Dependencies

pip freeze > requirements.txt

Notes

When configuring VKubefile.yaml, the build image context is "." (current directory where command is executed):

vkube deploy -f .VKubefile.yaml

For example, if running from vkube_cli directory, the build context is vkube_cli. Using COPY app.py /app in Dockerfile will fail if app.py doesn't exist in vkube_cli.

Known Issues

1. Docker Not Running

If Docker isn't running, you'll see:

Error: Unable to connect to Docker. Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

2. Image Push Failures

Network issues may prevent image pushing:

Pushing image encountering error: [{'status': 'The push refers to repository [docker.io/yourusername/myapp]'}, {'errorDetail': {'message': 'Get "https://registry-1.docker.io/v2/": net/http: TLS handshake timeout'}, 'error': 'Get "https://registry-1.docker.io/v2/": net/http: TLS handshake timeout'}]

Release CLI to PyPI

Build Package

Ensure setuptools, wheel and twine are installed:

pip install setuptools wheel twine

Build package from project root:

python setup.py sdist bdist_wheel

This creates a dist/ directory containing .tar.gz and .whl files for PyPI upload.

Generate Version Number from Git Tags

Install:

pip install setuptools_scm

Use specific tag to release:

git fetch --tags
git checkout v1.0.0  # switch to v1.0.0 tag

Upload to PyPI

twine upload dist/* -u __token__ -p <your-pypi-api-token>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vkube-2.0.0.tar.gz (36.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vkube-2.0.0-py3-none-any.whl (38.2 kB view details)

Uploaded Python 3

File details

Details for the file vkube-2.0.0.tar.gz.

File metadata

  • Download URL: vkube-2.0.0.tar.gz
  • Upload date:
  • Size: 36.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for vkube-2.0.0.tar.gz
Algorithm Hash digest
SHA256 01859ad6327ec998e52f80d658e0e5ece8758f6147fe833ca78ca174ef5c90e4
MD5 e9562a04c2f09173e285000ef7c2d6ec
BLAKE2b-256 b38fb3bf32acbc126e996e9682063a1345d23f2e5b7b957db74e01643d513be9

See more details on using hashes here.

File details

Details for the file vkube-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: vkube-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 38.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for vkube-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2452012a7504eca4db880f67c94754d4bcb9dbad74036bfe40cf36545b6b442a
MD5 51ee4d05ce163bb506411bad54b8b877
BLAKE2b-256 31c9947648faaccdb0d345dfae279ec20b3ffda9932fd35a949a98696c99baa3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page