-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from epics-containers/update-dependencies
Update dependencies
- Loading branch information
Showing
28 changed files
with
293 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ venv* | |
**/charts | ||
**/*copy | ||
*.code-workspace | ||
.ci_work |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: debug-adaravis | ||
labels: | ||
is_ioc: "true" | ||
spec: | ||
serviceAccountName: default-full-access-mounted | ||
containers: | ||
- name: debug-adaravis | ||
image: ghcr.io/epics-containers/ioc-adaravis-developer:2024.11.1 | ||
command: | ||
- bash | ||
args: | ||
- "-c" | ||
- | | ||
echo "keep running indefinetely" | ||
while true; do sleep 5; done | ||
resources: | ||
limits: | ||
memory: "2Gi" | ||
cpu: "4" | ||
requests: | ||
memory: "1Gi" | ||
cpu: "1" | ||
|
||
affinity: | ||
nodeAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
nodeSelectorTerms: | ||
- matchExpressions: | ||
- key: beamline | ||
operator: In | ||
values: | ||
- bl47p | ||
|
||
tolerations: | ||
- key: beamline | ||
operator: Equal | ||
value: bl47p | ||
effect: NoSchedule | ||
- key: location | ||
operator: Equal | ||
value: bl47p | ||
effect: NoSchedule | ||
- key: nodetype | ||
operator: Equal | ||
value: training-rig | ||
effect: NoSchedule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/usr/bin/env python | ||
|
||
""" | ||
Prints out some information about the pods in a namespace | ||
""" | ||
|
||
import argparse | ||
|
||
from kubernetes import client, config | ||
|
||
|
||
def get_ioc_ips(v1: client.CoreV1Api): | ||
"""Get the list cluster IPs of IOCs running in a namespace | ||
Args: | ||
v1: kubernetes client | ||
namespace: namespace to get the IOCs from | ||
""" | ||
ips = set() | ||
|
||
# get the current namespace | ||
ns_path = "/var/run/secrets/kubernetes.io/serviceaccount/namespace" | ||
with open(ns_path) as f: | ||
current_namespace = f.read().strip() | ||
|
||
# get the pods in the namespace | ||
ret = v1.list_namespaced_pod(current_namespace) | ||
for pod in ret.items: | ||
print(pod.metadata.name, pod.status.pod_ip) | ||
if "is_ioc" in pod.metadata.labels: | ||
ips.add(pod.status.pod_ip) | ||
|
||
return ips | ||
|
||
|
||
def main(): | ||
args = parse_args() | ||
|
||
# configure K8S and make a Core API client | ||
config.load_incluster_config() | ||
v1 = client.CoreV1Api() | ||
|
||
ips = get_ioc_ips(v1) | ||
ipstr = " ".join(ips) | ||
|
||
command = f'/epics/ca-gateway/bin/linux-x86_64/gateway -sport {args.port} -cip "{ipstr}" -pvlist /config/pvlist -access /config/access -log /dev/stdout -debug 1' | ||
|
||
# print(f"Running command: {command}") | ||
# subprocess.run(["bash", "-c", command], check=True) | ||
|
||
|
||
def parse_args(): | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("--port", type=int, default=5064) | ||
return parser.parse_args() | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# yaml-language-server: $schema=https://github.com/epics-containers/ec-helm-charts/releases/download/3.4.4/ioc-instance.schema.json#/$defs/service | ||
|
||
ioc-instance: | ||
image: ghcr.io/epics-containers/ioc-adaravis-runtime:2024.9.1 | ||
image: ghcr.io/epics-containers/ioc-adaravis-runtime:2024.11.2b1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# yaml-language-server: $schema=https://github.com/epics-containers/ec-helm-charts/releases/download/3.4.4/ioc-instance.schema.json#/$defs/service | ||
|
||
ioc-instance: | ||
image: ghcr.io/epics-containers/ioc-adaravis-runtime:2024.9.1 | ||
image: ghcr.io/epics-containers/ioc-adaravis-runtime:2024.11.2b1 |
Oops, something went wrong.