{"id":13446843,"url":"https://github.com/artsy/hokusai","last_synced_at":"2025-04-07T06:05:33.996Z","repository":{"id":13838155,"uuid":"75091616","full_name":"artsy/hokusai","owner":"artsy","description":"Artsy's Docker / Kubernetes CLI and Workflow","archived":false,"fork":false,"pushed_at":"2024-05-22T14:48:04.000Z","size":2527,"stargazers_count":90,"open_issues_count":19,"forks_count":25,"subscribers_count":40,"default_branch":"main","last_synced_at":"2024-05-22T15:47:16.916Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/artsy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-29T14:56:22.000Z","updated_at":"2024-08-26T18:00:55.171Z","dependencies_parsed_at":"2023-09-22T03:18:32.358Z","dependency_job_id":"f2da35a3-4d5b-4dbe-9d6a-9c392ed3d4ca","html_url":"https://github.com/artsy/hokusai","commit_stats":{"total_commits":801,"total_committers":38,"mean_commits":21.07894736842105,"dds":"0.21473158551810234","last_synced_commit":"0b36b5dac19f1e3ffb737c01bfd4903eda62423b"},"previous_names":[],"tags_count":59,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artsy%2Fhokusai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artsy%2Fhokusai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artsy%2Fhokusai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artsy%2Fhokusai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artsy","download_url":"https://codeload.github.com/artsy/hokusai/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247601447,"owners_count":20964864,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T05:01:01.375Z","updated_at":"2025-04-07T06:05:33.971Z","avatar_url":"https://github.com/artsy.png","language":"Python","funding_links":[],"categories":["Development with Docker","Developer Workflow"],"sub_categories":["Wrappers"],"readme":"## HOKUSAI [![CircleCI](https://circleci.com/gh/artsy/hokusai/tree/main.svg?style=svg)](https://circleci.com/gh/artsy/hokusai/tree/main)\n\n\u003ca href=\"https://en.wikipedia.org/wiki/Hokusai\"\u003e\u003cimg height=\"300\" src=\"hokusai.jpg\"\u003e\u003c/a\u003e\n\nHokusai is a Docker + Kubernetes CLI for application developers.\n\nHokusai \"dockerizes\" applications and manages their lifecycle throughout development, testing, and release cycles.\n\nHokusai wraps calls to [Kubectl](https://kubernetes.io/), [Docker](https://www.docker.com/), [Docker-Compose](https://docs.docker.com/compose/) and [Git](https://git-scm.com/) with a CLI, and defines a CI workflow.\n\nHokusai currently only supports Kubernetes deployments on AWS, configured to pull from ECS container repositories (ECR), although other providers may be added in the future.\n\n### Why Hokusai?\n\nAt [Artsy](http://www.artsy.net), as we began working with Kubernetes, while impressed with its design, capabilities, and flexibility, we were in need of tooling we could deliver to agile development teams that addressed the day-to-day tasks of application development, delivery, introspection and maintenance, while providing a clean and uncomplicated interface.\n\nTransitioning teams to the Docker / Kubernetes ecosystem can be intimidating, and comes with a steep learning curve. We set out to create a Heroku-like CLI that would shepherd the application developer into the ecosystems of Docker and Kubernetes, and while introducing new tooling and concepts, outlining a clear practice for dependency management, local development, testing and CI, image repository structure, deployment and orchestration.\n\n## Installation\n\n### MacOS\n\nWe recommend installing via Homebrew:\n\n```\n$ brew update\n$ brew tap artsy/formulas\n$ brew install hokusai\n```\n\nIf you previously installed Hokusai via an alternate installation method, you may need to force the `link` step.\n\n```\n$ brew link --overwrite hokusai\n```\n\nIf you previously installed Hokusai via Pip, you may want to first uninstall it:\n\n```\n$ pip uninstall hokusai\n```\n\n### Linux\n\n```\ncurl -sSL https://raw.githubusercontent.com/artsy/hokusai/main/get-hokusai.sh | sudo bash\n```\n\nNote: This method installs Hokusai to `/usr/local/bin/hokusai`.\n\n### Pip\n\nHokusai can be installed via Pip, on MacOS or Linux. If you do so, please first go through [Pyenv](#Pyenv), [Python](#Python), and [Virtualenv](#Virtualenv) steps.\n\nPython 3.7+ is required.\n\n```\npip install hokusai\n```\n\nNote: If Pip fails at upgrading your system Python packages, try:\n\n```\npip install hokusai --ignore-installed\n```\n\n### Docker\n\nWe also maintain [Hokusai Docker images](https://hub.docker.com/r/artsy/hokusai) for running Hokusai in Docker.\n\n### Github\n\nRelease artifacts are available on [Github](https://github.com/artsy/hokusai/releases).\n\n### AWS S3\n\nRelease artifacts are also available in AWS S3. You can use this [convenience script](get-hokusai.sh) or Curl to fetch them.\n\n### A note on Python 2.x\n\nHokusai currently supports Python 3.7+ only. The last version that supported Python 2.x was [v0.5.18](https://github.com/artsy/hokusai/tree/v0.5.18).\n\n## Setup\n\nWe assume that your org admin has already set up a Kubernetes cluster and an AWS infrastructure, and that your local environment has Git, Docker, and Docker-Compose installed. Perform the following steps to get Hokusai working:\n\n1. Ensure your org admin has completed the steps mentioned in [Administering Hokusai](./docs/Administering_Hokusai.md).\n\n2. Configure your local environment with [AWS credentials](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/configuration.html#configuring-credentials).\n\n3. Run [hokusai configure command](docs/Command_Reference.md#configuring-hokusai-for-your-organization).\n\n4. Optionally, enable Bash autocompletion:\n\n    ```\n    eval \"$(_HOKUSAI_COMPLETE=source hokusai)\"\n    ```\n\n## Getting Started\n\nOnce Hokusai is configured, you can start using it on a project. Please see [Getting Started](./docs/Getting_Started.md).\n\n## Command Reference\n\nA full command reference can be found in [Command Reference](./docs/Command_Reference.md).\n\n## Review Apps\n\nHokusai can be used to simplify the process of spinning up a \"review app\" instance of your project, based on a feature branch or pull request.\n\nFull details are in the [Review App reference](./docs/Review_Apps.md).\n\n## Hokusai Files\n\nA descripton of all the [files used by Hokusai](docs/hokusai_files.md).\n\n## Developing Hokusai\n\nTo work on Hokusai itself, please set up:\n\n### Pyenv\n\nWe recommend using [Pyenv](https://github.com/pyenv/pyenv) to install the correct version of Python. For a tutorial of Pyenv, see [this guide](https://realpython.com/intro-to-pyenv/).\n\nWhen installing on MacOS, please make sure to use brew-installed `openssl` and `readline` libraries, and xcode-installed `zlib` library. And make sure these libraries are correctly linked. Like so:\n\n```\nbrew install openssl readline zlib\n\necho 'export PATH=\"/usr/local/opt/openssl@1.1/bin:$PATH\"' \u003e\u003e ~/.bash_profile\necho 'export LDFLAGS=\"-L/usr/local/opt/openssl@1.1/lib\"' \u003e\u003e ~/.bash_profile\necho 'export CPPFLAGS=\"-I/usr/local/opt/openssl@1.1/include\"' \u003e\u003e ~/.bash_profile\necho 'export PKG_CONFIG_PATH=\"/usr/local/opt/openssl@1.1/lib/pkgconfig\"' \u003e\u003e ~/.bash_profile\n```\n\n### Python\n\nHokusai is currently tested on Python 3.10 so we recommend using that Python version.\n\nIf you use Pyenv to install Python, you should see an output similar to this:\n\n```\n$ pyenv install 3.10\npython-build: use openssl@1.1 from homebrew\npython-build: use readline from homebrew\nDownloading Python-3.10.13.tar.xz...\n-\u003e https://www.python.org/ftp/python/3.10.13/Python-3.10.13.tar.xz\nInstalling Python-3.10.13...\npython-build: use tcl-tk from homebrew\npython-build: use readline from homebrew\npython-build: use ncurses from homebrew\npython-build: use zlib from xcode sdk\nInstalled Python-3.10.13 to /Users/jxu/.pyenv/versions/3.10.13\n```\n\nWith the desired Python version installed, activate it globally:\n\n```\npyenv global 3.10\n```\n\nNote: If you want to create a PyInstaller distribution, Python must be installed with development libraries. Use the environment variable `PYTHON_CONFIGURE_OPTS=\"--enable-framework\"` on Darwin and `PYTHON_CONFIGURE_OPTS=\"--enable-shared\"` on Linux when running `pyenv install`.\n\n### Virtualenv\n\nWe recommend using a virtual environment to isolate Hokusai's dependencies from that of other projects on your local environment.\n\nThe Pyenv install comes with [pyenv-virtualenv](https://github.com/pyenv/pyenv-virtualenv) which can be used to create virtual environments.\n\n### Poetry\n\nUse [Poetry](https://python-poetry.org/) to install Hokusai's dependencies as well as Hokusai itself in [editable mode](https://pip-python3.readthedocs.io/en/latest/reference/pip_install.html#editable-installs). Please see [this guide](https://python-poetry.org/docs/basic-usage/) for working with Poetry.\n\nInstall Poetry:\n\n```\npip install --upgrade pip\npip install poetry\n```\n\nInstall dependencies and Hokusai in editable mode:\n\n```\npoetry install\n```\n\nTo update dependencies:\n\n```\npoetry lock\n```\n\n## Testing\n\n### Install Minikube\n\n[Minikube](https://minikube.sigs.k8s.io/docs/start/) is used for integration tests.\n\n```\nbrew install minikube\nminikube start --kubernetes-version=\u003cversion of your Kubernetes clusters, example: v1.2.3\u003e\n```\n\n### Run tests\n\nTo run unit tests:\n\n```\nmake test\n```\n\nTo run integration tests:\n\n```\nmake integration-local\n```\n\nOnly specific modules, TestClasses, or even methods:\n\n```\npython -m unittest test.unit.test_module.TestClass.test_method\n```\n\nTip: Set `DEBUG=1` environment variable to print boto logging\n\n\n## Distributing Hokusai\n\n### Beta Release\n\nMerging a branch into `main` automatically creates a beta version useful for testing. A [script](./scripts/update_version_file.sh) that runs in CI automatically generates a Beta version number and writes it into [VERSION](./hokusai/VERSION) file. The version number is based on the combination of the latest canonical version found in [RELEASE_VERSION](./hokusai/RELEASE_VERSION) file and the latest Git commit in `main` branch. [VERSION](./hokusai/VERSION) file in version control has just a dummy number (e.g. 999.999.999).\n\nTo install the beta:\n\n#### MacOS\n\n```\n$ brew uninstall hokusai\n$ brew uninstall hokusai-beta\n$ brew update\n$ brew tap artsy/formulas\n$ brew install hokusai-beta\n```\n\n#### Linux\n\n```\ncurl -sSL https://raw.githubusercontent.com/artsy/hokusai/main/get-hokusai.sh | sudo bash -s beta\n```\n\n### Official Release\n\nTo create an official release, such as `v1.2.3`, perform the following:\n\n- Create a branch named `prepare-v1.2.3` and make the following changes:\n  - Bump canonical version in [RELEASE_VERSION](./hokusai/RELEASE_VERSION) file.\n  - Upate [CHANGELOG](./CHANGELOG.md).\n  - Open a PR to merge into `main`. Please see [past PRs](https://github.com/artsy/hokusai/pulls?q=is%3Apr+Release+is%3Aclosed+%22prepare+version%22) for example.\n\n- [Open a PR](https://github.com/artsy/hokusai/compare/release...main?expand=1) to merge `main` into `release`. Please see [past PRs](https://github.com/artsy/hokusai/pulls?q=is%3Apr+is%3Aclosed+%22release+version%22) for example.\n\nA CI [script](./scripts/update_version_file.sh) will copy the version in [RELEASE_VERSION](./hokusai/RELEASE_VERSION) file to [VERSION](./hokusai/VERSION) file.\n\n## The Name\n\nThe project is named for the great Japanese artist [Katsushika Hokusai](https://www.artsy.net/article/artsy-editorial-7-things-hokusai-creator-great-wave) (1760-1849).\n\n## About Artsy\n\n\u003ca href=\"https://www.artsy.net/\"\u003e\n  \u003cimg align=\"left\" src=\"https://avatars2.githubusercontent.com/u/546231?s=200\u0026v=4\"/\u003e\n\u003c/a\u003e\n\nThis project is the work of engineers at [Artsy][footer_website], the world's\nleading and largest online art marketplace and platform for discovering art.\nOne of our core [Engineering Principles][footer_principles] is being [Open\nSource by Default][footer_open] which means we strive to share as many details\nof our work as possible.\n\nYou can learn more about this work from [our blog][footer_blog] and by following\n[@ArtsyOpenSource][footer_twitter] or explore our public data by checking out\n[our API][footer_api]. If you're interested in a career at Artsy, read through\nour [job postings][footer_jobs]!\n\n[footer_website]: https://www.artsy.net/\n[footer_principles]: https://github.com/artsy/README/blob/main/culture/engineering-principles.md\n[footer_open]: https://github.com/artsy/README/blob/main/culture/engineering-principles.md\n[footer_blog]: https://artsy.github.io/\n[footer_twitter]: https://twitter.com/ArtsyOpenSource\n[footer_api]: https://developers.artsy.net/\n[footer_jobs]: https://www.artsy.net/jobs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartsy%2Fhokusai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartsy%2Fhokusai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartsy%2Fhokusai/lists"}