Skip to content

Commit

Permalink
Update Dependencies (#28)
Browse files Browse the repository at this point in the history
* Update Dependencies

* Update Dependencies

* Update Dependencies

* Update Dependencies

* Update Dependencies

* Update Dependencies

* Update Dependencies

* Update Dependencies

* Update Dependencies
  • Loading branch information
JadCham authored Oct 14, 2024
1 parent 6d45197 commit f053408
Show file tree
Hide file tree
Showing 12 changed files with 342 additions and 229 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.github
tests
.venv
venv
.idea
31 changes: 21 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,31 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: [3.11, 3.12, 3.13]
fail-fast: false

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: pip install -r requirements.txt
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install the project
run: uv sync --all-extras --dev
- name: Install Kompose
run: curl -L https://github.com/kubernetes/kompose/releases/download/v1.25/kompose-linux-amd64 -o kompose && chmod +x kompose && sudo mv ./kompose /usr/bin/kompose
run: |
ARCH=$(uname -m)
if [ "$ARCH" = "x86_64" ]; then
ARCH="amd64"
elif [ "$ARCH" = "aarch64" ]; then
ARCH="arm64"
fi
curl -L https://github.com/kubernetes/kompose/releases/download/v1.34.0/kompose-linux-$ARCH -o kompose
chmod +x kompose
sudo mv ./kompose /usr/bin/kompose
- name: Show Kompose Version
run: kompose version
- name: Run Migrations
run: python manage.py makemigrations && python manage.py migrate
run: uv run python manage.py makemigrations && uv run python manage.py migrate
- name: Test
run: python manage.py test
run: uv run python manage.py test
17 changes: 0 additions & 17 deletions .rancher-pipeline.yml

This file was deleted.

22 changes: 14 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
FROM alpine as prep

ENV KOMPOSE_VERSION "v1.25"
ENV KOMPOSE_VERSION "v1.34.0"

RUN apk add curl
# To support multi-arch
ARG TARGETARCH

# Fetch kompose binary
RUN curl -L https://github.com/kubernetes/kompose/releases/download/$KOMPOSE_VERSION/kompose-linux-amd64 -o /tmp/kompose
RUN apk add curl

# Fetch the correct kompose binary based on the target architecture
RUN curl -L https://github.com/kubernetes/kompose/releases/download/$KOMPOSE_VERSION/kompose-linux-$TARGETARCH -o /tmp/kompose

FROM python:3.9-alpine
FROM python:3.13-alpine

COPY --from=prep /tmp/kompose /usr/local/bin/kompose

RUN chmod +x /usr/local/bin/kompose

WORKDIR /usr/src/app

COPY requirements.txt ./
RUN pip install -r requirements.txt

COPY . .

COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv

RUN uv sync --frozen

ENV PATH="/usr/src/app/.venv/bin:$PATH"


RUN python manage.py collectstatic --no-input
RUN python manage.py makemigrations
RUN python manage.py migrate
Expand Down
27 changes: 4 additions & 23 deletions kompose_ui/urls.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,11 @@
"""kompose_ui URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""

from django.contrib import admin
from django.conf.urls import url, include
from django.urls import path, include
from django.conf.urls.static import static
from django.conf import settings


urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^', include('webapp.urls')),
path('admin/', admin.site.urls),
path('', include('webapp.urls')),
]

urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)


urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
27 changes: 27 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

[project]
name = "komposeui"
dynamic = ["version"]
description = "A Django project for visualizing Docker Compose to Kubernetes transformations"
readme = "README.md"
requires-python = ">=3.10,<3.14"
authors = [
{ name = "Jad Chamoun"},
{ name = "Joe Haddad" },
]

dependencies = [
"Django==5.1.2",
"pytz==2024.2",
"pyyaml==6.0.2",
]


[tool.setuptools.packages]
find = { include = ["kompose_ui"] }

[project.urls]
Homepage = "https://composetokube.com/"
Documentation = "https://composetokube.com/docs/"
Repository = "https://github.com/JadCham/komposeui"
Issues = "https://github.com/JadCham/komposeui/issues"
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Django==2.2.24
pytz==2017.2
pyyaml==5.4
Django==5.1.2
pytz==2024.2
pyyaml==6.0.2
Loading

0 comments on commit f053408

Please sign in to comment.