Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for hushline on Ubuntu 24.04 LTS + podman containers #632

Open
2 tasks
rmlibre opened this issue Oct 2, 2024 · 0 comments
Open
2 tasks

support for hushline on Ubuntu 24.04 LTS + podman containers #632

rmlibre opened this issue Oct 2, 2024 · 0 comments

Comments

@rmlibre
Copy link
Contributor

rmlibre commented Oct 2, 2024

These are the steps I took to get hushline working on Ubuntu 24.04 LTS with podman containers. Though, this isn't a clean guide, since it also includes the setup instructions used to run hushline without containerization. There are likely redundancies that can be pruned and still get it running.

Setup Machine

~$ sudo apt-get --fix-missing --install-recommends update
~$ sudo apt-get --fix-missing --fix-broken --install-recommends dist-upgrade
~$ sudo apt-get --fix-missing --fix-broken --install-recommends install npm pipx podman podman-compose

NOTE: I initially installed npm to run hushline before I got podman working. I'm not positive if it's actually necessary now.

Custom File Edits

  • git patch file to swap docker with podman in build scripts

'scripts/local-postgres.sh'

#!/usr/bin/env bash

podman run --rm -t -p 127.0.0.1:5432:5432 \
    -e POSTGRES_USER=hushline \
    -e POSTGRES_PASSWORD=hushline \
    -e POSTGRES_DB=hushline \
    postgres:16.4-alpine3.20

'Makefile'

.PHONY: lint
lint: ## Lint the code
	poetry run ruff format --check && \
	poetry run ruff check && \
	poetry run mypy . && \
	podman compose run --rm app npx prettier --check ./*.md ./docs ./.github/workflows/* ./hushline

.PHONY: fix
fix: ## Format the code
	poetry run ruff format && \
	poetry run ruff check --fix && \
	podman compose run --rm app npx prettier --write ./*.md ./docs ./.github/workflows/* ./hushline

...

.PHONY: test
test: ## Run the test suite
	podman compose run --rm app \
		poetry run pytest --cov hushline --cov-report term --cov-report html -vv $(PYTEST_ADDOPTS) tests/$(test)

Setup hushline

~$ cd /path/to/local/hushline/repo
~$ pipx ensurepath
~$ pipx install poetry
~$ npm install --save-dev prettier-plugin-jinja-template
~$ podman pull docker.io/postgres:16.4-alpine3.20
~$ make install
~$ podman build . -f Dockerfile.dev -t hushline

Run hushline

terminal # 1

~$ podman-compose down
~$ podman-compose up --build

terminal # 2

~$ podman-compose run --rm app bash
root@xxxxxxxxxxxx:/app# poetry shell
(hushline-py3.12) root@xxxxxxxxxxxx:/app# make migrate-dev
(hushline-py3.12) root@xxxxxxxxxxxx:/app# ./scripts/dev_data.py

browser # 1

open http://localhost:8080/

Cleanup hushline

close down session

~$ podman-compose down

view all containers

~$ podman ps -a

shutdown container by ID

~$ podman kill <container-ID>

clear all shutdown containers

~$ podman container prune

shutdown & clear all containers & data volumes

~$ podman stop -a && podman rm -afv

TODO:

  • work out how to persist & designate database volumes
  • write container tool agnostic build scripts
rmlibre added a commit to rmlibre/hushline that referenced this issue Oct 2, 2024
Git patch files can be downloaded and applied on any HEAD:
``git apply docker_podman_replacements.patch``

This file was produced by saving the relevant diff:
``git diff > volumes/docker_podman_replacements.patch``
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant