nebula-docker


Namenebula-docker JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/kozmoai/nebula-docker
SummaryNebula integrations for working with Docker
upload_time2024-03-25 14:12:48
maintainerNone
docs_urlNone
authorKozmoai, Inc.
requires_python>=3.7
licenseApache License 2.0
keywords nebula
VCS
bugtrack_url
requirements nebulaconsole docker
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # nebula-docker

<p align="center">
    <a href="https://pypi.python.org/pypi/nebula-docker/" alt="PyPI version">
        <img alt="PyPI" src="https://img.shields.io/pypi/v/nebula-docker?color=26272B&labelColor=090422"></a>
    <a href="https://github.com/kozmoai/nebula-docker/" alt="Stars">
        <img src="https://img.shields.io/github/stars/kozmoai/nebula-docker?color=26272B&labelColor=090422" /></a>
    <a href="https://pepy.tech/badge/nebula-docker/" alt="Downloads">
        <img src="https://img.shields.io/pypi/dm/nebula-docker?color=26272B&labelColor=090422" /></a>
    <a href="https://github.com/kozmoai/nebula-docker/pulse" alt="Activity">
        <img src="https://img.shields.io/github/commit-activity/m/kozmoai/nebula-docker?color=26272B&labelColor=090422" /></a>
    <br>
    <a href="https://nebula-community.slack.com" alt="Slack">
        <img src="https://img.shields.io/badge/slack-join_community-red.svg?color=26272B&labelColor=090422&logo=slack" /></a>

</p>

## Welcome!

Nebula integrations for working with Docker.

Note! The `DockerRegistryCredentials` in `nebula-docker` is a unique block, separate from the `DockerRegistry` in `nebula` core. While `DockerRegistry` implements a few functionality from both `DockerHost` and `DockerRegistryCredentials` for convenience, it does not allow much configuration to interact with a Docker host.

Do not use `DockerRegistry` with this collection. Instead, use `DockerHost` and `DockerRegistryCredentials`.

## Getting Started

### Python setup

Requires an installation of Python 3.8+.

We recommend using a Python virtual environment manager such as pipenv, conda, or virtualenv.

These tasks are designed to work with Nebula 2. For more information about how to use Nebula, please refer to the [Nebula documentation](https://docs.nebula.io/).

### Installation

Install `nebula-docker` with `pip`:

```bash
pip install nebula-docker
```

Then, register to [view the block](https://docs.nebula.io/concepts/blocks/) on Nebula Cloud:

```bash
nebula block register -m nebula_docker
```

Note, to use the `load` method on Blocks, you must already have a block document [saved through code](https://docs.nebula.io/concepts/blocks/#saving-blocks) or saved through the UI.

### Pull image, and create, start, log, stop, and remove Docker container

```python
from nebula import flow, get_run_logger
from nebula_docker.images import pull_docker_image
from nebula_docker.containers import (
    create_docker_container,
    start_docker_container,
    get_docker_container_logs,
    stop_docker_container,
    remove_docker_container,
)


@flow
def docker_flow():
    logger = get_run_logger()
    pull_docker_image("kozmoai/nebula", "latest")
    container = create_docker_container(
        image="kozmoai/nebula", command="echo 'hello world!' && sleep 60"
    )
    start_docker_container(container_id=container.id)
    logs = get_docker_container_logs(container_id=container.id)
    logger.info(logs)
    stop_docker_container(container_id=container.id)
    remove_docker_container(container_id=container.id)
    return container
```

### Use a custom Docker Host to create a Docker container
```python
from nebula import flow
from nebula_docker import DockerHost
from nebula_docker.containers import create_docker_container

@flow
def create_docker_container_flow():
    docker_host = DockerHost(
        base_url="tcp://127.0.0.1:1234",
        max_pool_size=4
    )
    container = create_docker_container(
        docker_host=docker_host,
        image="kozmoai/nebula",
        command="echo 'hello world!'"
    )

create_docker_container_flow()
```

## Resources

If you encounter any bugs while using `nebula-docker`, feel free to open an issue in the [nebula-docker](https://github.com/kozmoai/nebula-docker) repository.

If you have any questions or issues while using `nebula-docker`, you can find help in the [Nebula Slack community](https://nebula.io/slack).

Feel free to ⭐️ or watch [`nebula-docker`](https://github.com/kozmoai/nebula-docker) for updates too!

## Development

If you'd like to install a version of `nebula-docker` for development, clone the repository and perform an editable install with `pip`:

```bash
git clone https://github.com/kozmoai/nebula-docker.git

cd nebula-docker/

pip install -e ".[dev]"

# Install linting pre-commit hooks
pre-commit install
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/kozmoai/nebula-docker",
    "name": "nebula-docker",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "nebula",
    "author": "Kozmoai, Inc.",
    "author_email": "help@kozmoai.org",
    "download_url": "https://files.pythonhosted.org/packages/3d/0f/00dfbb0d51c8dce877fae7ce1f79bf018f7d935fd120bbe90df07d313587/nebula-docker-1.0.0.tar.gz",
    "platform": null,
    "description": "# nebula-docker\n\n<p align=\"center\">\n    <a href=\"https://pypi.python.org/pypi/nebula-docker/\" alt=\"PyPI version\">\n        <img alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/nebula-docker?color=26272B&labelColor=090422\"></a>\n    <a href=\"https://github.com/kozmoai/nebula-docker/\" alt=\"Stars\">\n        <img src=\"https://img.shields.io/github/stars/kozmoai/nebula-docker?color=26272B&labelColor=090422\" /></a>\n    <a href=\"https://pepy.tech/badge/nebula-docker/\" alt=\"Downloads\">\n        <img src=\"https://img.shields.io/pypi/dm/nebula-docker?color=26272B&labelColor=090422\" /></a>\n    <a href=\"https://github.com/kozmoai/nebula-docker/pulse\" alt=\"Activity\">\n        <img src=\"https://img.shields.io/github/commit-activity/m/kozmoai/nebula-docker?color=26272B&labelColor=090422\" /></a>\n    <br>\n    <a href=\"https://nebula-community.slack.com\" alt=\"Slack\">\n        <img src=\"https://img.shields.io/badge/slack-join_community-red.svg?color=26272B&labelColor=090422&logo=slack\" /></a>\n\n</p>\n\n## Welcome!\n\nNebula integrations for working with Docker.\n\nNote! The `DockerRegistryCredentials` in `nebula-docker` is a unique block, separate from the `DockerRegistry` in `nebula` core. While `DockerRegistry` implements a few functionality from both `DockerHost` and `DockerRegistryCredentials` for convenience, it does not allow much configuration to interact with a Docker host.\n\nDo not use `DockerRegistry` with this collection. Instead, use `DockerHost` and `DockerRegistryCredentials`.\n\n## Getting Started\n\n### Python setup\n\nRequires an installation of Python 3.8+.\n\nWe recommend using a Python virtual environment manager such as pipenv, conda, or virtualenv.\n\nThese tasks are designed to work with Nebula 2. For more information about how to use Nebula, please refer to the [Nebula documentation](https://docs.nebula.io/).\n\n### Installation\n\nInstall `nebula-docker` with `pip`:\n\n```bash\npip install nebula-docker\n```\n\nThen, register to [view the block](https://docs.nebula.io/concepts/blocks/) on Nebula Cloud:\n\n```bash\nnebula block register -m nebula_docker\n```\n\nNote, to use the `load` method on Blocks, you must already have a block document [saved through code](https://docs.nebula.io/concepts/blocks/#saving-blocks) or saved through the UI.\n\n### Pull image, and create, start, log, stop, and remove Docker container\n\n```python\nfrom nebula import flow, get_run_logger\nfrom nebula_docker.images import pull_docker_image\nfrom nebula_docker.containers import (\n    create_docker_container,\n    start_docker_container,\n    get_docker_container_logs,\n    stop_docker_container,\n    remove_docker_container,\n)\n\n\n@flow\ndef docker_flow():\n    logger = get_run_logger()\n    pull_docker_image(\"kozmoai/nebula\", \"latest\")\n    container = create_docker_container(\n        image=\"kozmoai/nebula\", command=\"echo 'hello world!' && sleep 60\"\n    )\n    start_docker_container(container_id=container.id)\n    logs = get_docker_container_logs(container_id=container.id)\n    logger.info(logs)\n    stop_docker_container(container_id=container.id)\n    remove_docker_container(container_id=container.id)\n    return container\n```\n\n### Use a custom Docker Host to create a Docker container\n```python\nfrom nebula import flow\nfrom nebula_docker import DockerHost\nfrom nebula_docker.containers import create_docker_container\n\n@flow\ndef create_docker_container_flow():\n    docker_host = DockerHost(\n        base_url=\"tcp://127.0.0.1:1234\",\n        max_pool_size=4\n    )\n    container = create_docker_container(\n        docker_host=docker_host,\n        image=\"kozmoai/nebula\",\n        command=\"echo 'hello world!'\"\n    )\n\ncreate_docker_container_flow()\n```\n\n## Resources\n\nIf you encounter any bugs while using `nebula-docker`, feel free to open an issue in the [nebula-docker](https://github.com/kozmoai/nebula-docker) repository.\n\nIf you have any questions or issues while using `nebula-docker`, you can find help in the [Nebula Slack community](https://nebula.io/slack).\n\nFeel free to \u2b50\ufe0f or watch [`nebula-docker`](https://github.com/kozmoai/nebula-docker) for updates too!\n\n## Development\n\nIf you'd like to install a version of `nebula-docker` for development, clone the repository and perform an editable install with `pip`:\n\n```bash\ngit clone https://github.com/kozmoai/nebula-docker.git\n\ncd nebula-docker/\n\npip install -e \".[dev]\"\n\n# Install linting pre-commit hooks\npre-commit install\n```\n",
    "bugtrack_url": null,
    "license": "Apache License 2.0",
    "summary": "Nebula integrations for working with Docker",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/kozmoai/nebula-docker"
    },
    "split_keywords": [
        "nebula"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "45129263b82e08913706e64446c314c7b69c655dc1bf2fe0eb7f155f52ef8d95",
                "md5": "ae090757a41e810da0bf37ae1e2de386",
                "sha256": "96382ef888c38b8bcf76e5dc520f18499d2f4776c24e6a0e9ed3ab8a6ce08e90"
            },
            "downloads": -1,
            "filename": "nebula_docker-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ae090757a41e810da0bf37ae1e2de386",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 24969,
            "upload_time": "2024-03-25T14:12:46",
            "upload_time_iso_8601": "2024-03-25T14:12:46.921392Z",
            "url": "https://files.pythonhosted.org/packages/45/12/9263b82e08913706e64446c314c7b69c655dc1bf2fe0eb7f155f52ef8d95/nebula_docker-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3d0f00dfbb0d51c8dce877fae7ce1f79bf018f7d935fd120bbe90df07d313587",
                "md5": "6774f1ae93e8f3fa1fe8e43ef81d293f",
                "sha256": "36a04d0d57e206477a2699a242abe97f9c0f5ffd700be9b75a702e16b445ea83"
            },
            "downloads": -1,
            "filename": "nebula-docker-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "6774f1ae93e8f3fa1fe8e43ef81d293f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 48560,
            "upload_time": "2024-03-25T14:12:48",
            "upload_time_iso_8601": "2024-03-25T14:12:48.512628Z",
            "url": "https://files.pythonhosted.org/packages/3d/0f/00dfbb0d51c8dce877fae7ce1f79bf018f7d935fd120bbe90df07d313587/nebula-docker-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-25 14:12:48",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "kozmoai",
    "github_project": "nebula-docker",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "nebulaconsole",
            "specs": []
        },
        {
            "name": "docker",
            "specs": [
                [
                    ">=",
                    "6.1.1"
                ]
            ]
        }
    ],
    "lcname": "nebula-docker"
}
        
Elapsed time: 0.35492s