Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions appstore/appstore/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@
"IMAGE_DOWNLOAD_URL", "https://braini-metalnx.renci.org/metalnx"
)

GITEA_BASE_URL = os.environ.get("GITEA_BASE_URL")

DJANGO_APPS = [
"django.contrib.admin",
"django.contrib.contenttypes",
Expand Down
5 changes: 5 additions & 0 deletions appstore/product/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,8 @@ class ProductSettings:
color_scheme: ProductColorScheme = ProductColorScheme()
capabilities: List[str] = field(default_factory=lambda: ['app', 'search'])

def __post_init__(self):
from appstore.settings.base import GITEA_BASE_URL
if GITEA_BASE_URL:
if self.links is None: self.links = []
self.links.append(ProductLink("Gitea", GITEA_BASE_URL))
3 changes: 0 additions & 3 deletions appstore/tycho/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,6 @@ def start (self, principal, app_id, resource_request, host, extra_container_env=
proxy_rewrite = self.apps.get(app_id).get("proxy-rewrite", { "enabled":False, "target":None })
spec["services"][app_id]["proxy_rewrite"] = proxy_rewrite
if proxy_rewrite_rule: spec["services"][app_id]["proxy_rewrite"]["enabled"] = True
""" Add gitea integration rule """
gitea_integration = self.apps.get(app_id).get("gitea-integration", False)
spec["services"][app_id]["gitea_integration"] = gitea_integration

if spec is not None:
system = self._start ({
Expand Down
8 changes: 1 addition & 7 deletions appstore/tycho/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def __repr__(self):
class System:
""" Distributed system of interacting containerized software. """
def __init__(self, config, name, principal, service_account, conn_string, proxy_rewrite, containers, identifier,
gitea_integration, services={}, security_context={}, init_security_context={}):
services={}, security_context={}, init_security_context={}):
""" Construct a new abstract model of a system given a name and set of containers.

Serves as context for the generation of compute cluster specific artifacts.
Expand Down Expand Up @@ -250,11 +250,6 @@ def __init__(self, config, name, principal, service_account, conn_string, proxy_
self.nfsrods_host = os.environ.get('NFSRODS_HOST', '')
else:
logger.info("Irods host not enabled")
"""gitea settings"""
self.gitea_integration = gitea_integration
self.gitea_host = os.environ.get("GITEA_HOST", " ")
self.gitea_user = os.environ.get("GITEA_USER", " ")
self.gitea_service_name = os.environ.get("GITEA_SERVICE_NAME", " ")
self.ambassador_service_name = os.environ.get("AMBASSADOR_SVC_NAME", "")

@staticmethod
Expand Down Expand Up @@ -456,7 +451,6 @@ def parse (config, name, principal, system, service_account, env={}, services={}
"proxy_rewrite": spec.get("proxy_rewrite", { 'target':None, 'enabled':False }),
"containers": containers,
"identifier": identifier,
"gitea_integration": spec.get("gitea_integration", False),
"services": services,
"security_context": security_context,
"init_security_context": init_security_context
Expand Down
17 changes: 0 additions & 17 deletions appstore/tycho/template/pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,6 @@ spec:

mkdir -p "$HOME_PATH"
mkdir -p "$SHARED_OLD_PATH"

{% if system.gitea_integration == True %}
mkdir -p "$HOME_PATH/.ssh"
echo -e "Host {{ system.gitea_host }}\n Hostname {{ system.gitea_service_name }}\n User {{ system.gitea_user }}\n IdentityFile ~/.ssh/id_gitea" > $HOME_PATH/.ssh/config
{% endif %}

{% if system.enable_trash_cli == "true" %}
HOME_TRASH="${XDG_DATA_HOME:-$HOME_PATH/.local/share}/Trash"
Expand Down Expand Up @@ -341,12 +336,6 @@ spec:
- name: nfs
mountPath: "/home/nfs"
{% endif %}
{% if system.gitea_integration == True %}
- name: {{ system.username_all_hyphens }}-id-gitea
mountPath: {{ system.parent_dir }}/{{ system.subpath_dir }}/.ssh/id_gitea
subPath: id_gitea
readOnly: true
{% endif %}
{% if container.volumes %}
{% for volume in system.volumes %}
{% if container.name == volume['container_name'] %}
Expand Down Expand Up @@ -431,12 +420,6 @@ spec:
server: {{ system.nfsrods_host }}
path: /
{% endif %}
{% if system.gitea_integration == True %}
- name: {{ system.username_all_hyphens }}-id-gitea
secret:
secretName: {{ system.username_all_hyphens }}-id-gitea
defaultMode: 0600
{% endif %}
# Changes
{% for container in system.containers %}
{% if container.volumes %}
Expand Down
Loading