diff --git a/.gitignore b/.gitignore index 1292873..e50b750 100644 --- a/.gitignore +++ b/.gitignore @@ -11,5 +11,6 @@ __pycache__ /*.xz /*.flatpak +/builddir build-aux/flatpak-pip-generator diff --git a/Makefile b/Makefile index edca48f..6f49009 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,8 @@ BUILD_ROOT = $(PROJECT_ROOT)/.flatpak-builder FLATPAK_BUNDLE ?= $(PROJECT_ROOT)/$(APP_ID).flatpak +FLATPAK_RUN_COMMAND ?= k3x + STATE_DIR = $(BUILD_ROOT) CCACHE_DIR = $(BUILD_ROOT)/ccache BUILD_DIR ?= $(BUILD_ROOT)/build/staging @@ -116,13 +118,6 @@ help: ## Show this help screen ############################## ##@ Development -pypi-dependencies.json: build-aux/flatpak-pip-generator requirements.txt - build-aux/flatpak-pip-generator --requirements-file=requirements.txt --output pypi-dependencies - -build-aux/flatpak-pip-generator: - curl -o build-aux/flatpak-pip-generator https://raw.githubusercontent.com/flatpak/flatpak-builder-tools/master/pip/flatpak-pip-generator - chmod 755 build-aux/flatpak-pip-generator - deps: ## Install all the required dependencies for building/running @printf "$(CYN)>>> $(GRN)Adding flatpak dependencies (apps, frameworks...)...$(END)\n" flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo @@ -162,9 +157,13 @@ run: $(BUILD_DIR)/build.ninja ## Run the application locally printf "$(CYN)>>> $(GRN)Running ninja install (in build_dir=$(BUILD_DIR))...$(END)\n" && \ flatpak build --build-dir=$(BUILD_DIR) $(FLATPAK_BUILD_ARGS) ninja install - @printf "$(CYN)>>> $(GRN)Running k3x in a sandbox...$(END)\n" + @printf "$(CYN)>>> $(GRN)Running $(FLATPAK_RUN_COMMAND) in the sandbox...$(END)\n" $(Q)flatpak-builder $(FLATPAK_RUN_ARGS) $(FLATPAK_RUN_SHARES) --run $(BUILD_DIR) $(FLATPAK_MANIFEST) \ - k3x + $(FLATPAK_RUN_COMMAND) + +.PHONY: shell +shell: FLATPAK_RUN_COMMAND=bash +shell: run ## Run a shell in the sandbox ############################## # Clean @@ -216,6 +215,13 @@ $(FLATPAK_BUNDLE): $(FLATPAK_MANIFEST) $(APP_SRC_MESONS) $(APP_SRC_PY) $(APP_SRC $(Q)flatpak build-bundle --arch=x86_64 $(FLATPAK_REPO_DIR) $(FLATPAK_BUNDLE) $(APP_ID) master @printf "$(CYN)>>> $(GRN)Bundle available at $(FLATPAK_BUNDLE)$(END)\n" +generate: build-aux/flatpak-pip-generator requirements.txt ## Regenerate some files (ie, pypi-dependencies.json) + build-aux/flatpak-pip-generator --requirements-file=requirements.txt --output pypi-dependencies + +build-aux/flatpak-pip-generator: + curl -o build-aux/flatpak-pip-generator https://raw.githubusercontent.com/flatpak/flatpak-builder-tools/master/pip/flatpak-pip-generator + chmod 755 build-aux/flatpak-pip-generator + ############################## # releases ############################## diff --git a/com.github.inercia.k3x.json b/com.github.inercia.k3x.json index 5dc8564..4cf6606 100644 --- a/com.github.inercia.k3x.json +++ b/com.github.inercia.k3x.json @@ -1,10 +1,10 @@ { "app-id": "com.github.inercia.k3x", + "runtime": "org.gnome.Platform", + "runtime-version": "3.36", + "sdk": "org.gnome.Sdk", "base": "io.elementary.BaseApp", "base-version": "juno-19.08", - "runtime": "org.freedesktop.Platform", - "sdk": "org.freedesktop.Sdk", - "runtime-version": "19.08", "command": "k3x", "finish-args": [ "--device=dri", diff --git a/data/com.github.inercia.k3x.appdata.xml.in b/data/com.github.inercia.k3x.appdata.xml.in index 4ac6769..302ed61 100644 --- a/data/com.github.inercia.k3x.appdata.xml.in +++ b/data/com.github.inercia.k3x.appdata.xml.in @@ -1,67 +1,67 @@ - com.github.inercia.k3x.desktop - CC0-1.0 - MIT - k3x - Alvaro Saurin - - Game - GTK - - - com.github.inercia.k3x - - - - https://raw.githubusercontent.com/inercia/k3x/master/docs/screenshots/create-new-dialog-general.png - - - https://raw.githubusercontent.com/inercia/k3x/master/docs/screenshots/create-new-dialog-advanced.png - - - -

k3x is a graphical user interface for k3d (/~https://github.com/rancher/k3d), making it trivial to have your own local Kubernetes cluster(s).

-

k3x is perfect for:

+ com.github.inercia.k3x.desktop + CC0-1.0 + MIT + k3x + Manager for local Kubernetes clusters with k3d + Alvaro Saurin + + Game + GTK + + + com.github.inercia.k3x + + + + https://raw.githubusercontent.com/inercia/k3x/master/docs/screenshots/create-new-dialog-general.png + + + https://raw.githubusercontent.com/inercia/k3x/master/docs/screenshots/create-new-dialog-advanced.png + + + +

k3x is a graphical user interface for k3d (/~https://github.com/rancher/k3d), making it trivial to have your own local Kubernetes cluster(s).

+

k3x is perfect solution for:

+
    +
  • having a fresh Kubernetes cluster in a couple of seconds.
  • +
  • trying new deployments before going in production.
  • +
  • learning about Kubernetes.
  • +
+

the k3x project goals are:

+
    +
  • to create/switch-to/destroy Kubernetes clusters easily.
  • +
  • to drive the most important operations with global keyboard shortcuts.
  • +
  • to reduce the learning curve of using Kubernetes.
  • +
+
+ + + +

Fist release!

    -
  • having a fresh Kubernetes cluster in a couple of seconds.
  • -
  • trying new deployments before going in production.
  • -
  • learning about Kubernetes.
  • +
  • Initial release.
-

k3x goals are:

-
    -
  • to create/switch-to/destroy Kubernetes clusters easily.
  • -
  • to drive the most important operations with global keyboard shortcuts.
  • -
  • to reduce the learning curve of using Kubernetes.
  • -
-
- - - -

Fist release!

-
    -
  • Initial release.
  • -
-
-
-
- - none - none - none - none - none - none - none - - /~https://github.com/inercia/k3x - /~https://github.com/inercia/k3x/issues - /~https://github.com/inercia/k3x/issues - alvaro.saurin@gmail.com - - #82ffc4 - #000000 - 0 - +
+ + + + none + none + none + none + none + none + none + + /~https://github.com/inercia/k3x + /~https://github.com/inercia/k3x/issues + /~https://github.com/inercia/k3x/issues + alvaro.saurin@gmail.com + + #82ffc4 + #000000 + 0 +
- diff --git a/src/k3x.in b/src/k3x.in index b1044f6..69bd4d5 100755 --- a/src/k3x.in +++ b/src/k3x.in @@ -37,6 +37,12 @@ sys.path.insert(1, pkgdatadir) signal.signal(signal.SIGINT, signal.SIG_DFL) gettext.install('k3x', localedir) +# extra search path (in reverse order of precedence) +GI_EXTRA_SEARCH_PATH = [ + '/usr/lib/x86_64-linux-gnu/girepository-1.0', + '@PREFIX@/lib/girepository-1.0/' +] + if __name__ == '__main__': import gi @@ -44,15 +50,18 @@ if __name__ == '__main__': resource = Gio.Resource.load(os.path.join(pkgdatadir, 'k3x.gresource')) resource._register() - print(f"[PRE-MAIN] Adding to GI path @PREFIX@/lib/girepository-1.0/") import gi.repository # Set the search path to use the newly generated introspection files gi.require_version('GIRepository', '2.0') + + # FIXME: for some unknown reason, we must add the standard GI paths from gi.repository import GIRepository - GIRepository.Repository.prepend_search_path('@PREFIX@/lib/girepository-1.0/') + for d in GI_EXTRA_SEARCH_PATH: + GIRepository.Repository.prepend_search_path(d) + print("GI search path:") for p in GIRepository.Repository.get_search_path(): - print("[PRE-MAIN] - " + p) + print("[PRE-MAIN] [search-path] - " + p) print(f"[PRE-MAIN] Current LD_LIBRARY_PATH: " + os.getenv("LD_LIBRARY_PATH", default="")) diff --git a/src/kubectl.py b/src/kubectl.py index 691e5a0..8cd3006 100644 --- a/src/kubectl.py +++ b/src/kubectl.py @@ -47,7 +47,7 @@ def run_kubectl_command(*args, **kwargs) -> Iterator[str]: env["KUBECONFIG"] = kubeconfig kwargs["env"] = env - logging.debug(f"[KUBECTL] Running kubectl command {args} {kwargs}") + logging.debug(f"[KUBECTL] Running kubectl command {args}") # IMPORTANT: remember to "consume" this iterator, or this will not be run at all yield from run_command_stdout(kubectl_exe, *args, **kwargs)