Skip to content

Commit

Permalink
Initial commits
Browse files Browse the repository at this point in the history
  • Loading branch information
feiskyer committed Jan 2, 2024
1 parent 4418163 commit 35626b1
Show file tree
Hide file tree
Showing 60 changed files with 1,750 additions and 5,116 deletions.
15 changes: 12 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,16 @@

version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"
interval: daily
labels:
- "bot"
open-pull-requests-limit: 5

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 5
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
push:
branches:
- "main"
- "master"

env:
REGISTRY: ghcr.io
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Test

on:
pull_request: {}
push:
branches:
- "master"

jobs:
build:
name: Test
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.x
uses: actions/setup-go@v5

- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Test
run: go test -v ./...
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ index.yaml
# C extensions
*.so

# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so

# Distribution / packaging
.Python
build/
Expand All @@ -33,6 +38,27 @@ share/python-wheels/
*.egg
MANIFEST

# Folders
_obj
_test

# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out

*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*

_testmain.go

*.exe
*.test
*.prof
_out

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
Expand Down Expand Up @@ -108,6 +134,7 @@ celerybeat.pid
*.sage.py

# Environments
.vscode
.env
.venv
env/
Expand Down
60 changes: 0 additions & 60 deletions CHANGELOG.md

This file was deleted.

38 changes: 16 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
# Builder image
FROM python:3.11-bullseye AS builder

RUN curl -sSL https://install.python-poetry.org | python3 -

WORKDIR /app
COPY . /app

RUN /root/.local/bin/poetry install && /root/.local/bin/poetry build && \
pip install dist/*.whl

# build stage
FROM golang:alpine AS builder
ADD . /go/src/github.com/feiskyer/kube-copilot
RUN cd /go/src/github.com/feiskyer/kube-copilot && \
apk update && apk add --no-cache gcc musl-dev openssl && \
CGO_ENABLED=0 go build -o _out/kube-copilot ./cmd/kube-copilot

# Final image
FROM python:3.11-bullseye
FROM alpine
# EXPOSE 80
WORKDIR /

RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \
chmod +x kubectl && mv kubectl /usr/local/bin/kubectl && \
wget https://github.com/aquasecurity/trivy/releases/download/v0.18.3/trivy_0.18.3_Linux-64bit.deb && \
dpkg -i trivy_0.18.3_Linux-64bit.deb && rm -f trivy_0.18.3_Linux-64bit.deb && \
useradd --create-home --shell /bin/bash copilot
RUN apk add --update curl wget python3 py3-pip curl && \
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \
chmod +x kubectl && mv kubectl /usr/local/bin && \
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin v0.48.1 && \
rm -rf /var/cache/apk/* && \
mkdir -p /etc/kube-copilot

COPY --from=builder /app/dist/*.whl /tmp
RUN pip install /tmp/*.whl && rm -f /tmp/*.whl
COPY web /app
COPY --from=builder /go/src/github.com/feiskyer/kube-copilot/_out/kube-copilot /usr/local/bin/

USER copilot
COPY web/config.toml /home/copilot/.streamlit/config.toml

ENTRYPOINT [ "/usr/local/bin/kube-copilot" ]
60 changes: 0 additions & 60 deletions Makefile

This file was deleted.

Loading

0 comments on commit 35626b1

Please sign in to comment.