Skip to content

Commit 7b36270

Browse files
authored
Merge pull request #70 from francescotimperi/private-registry
[FEATURE] Implements apache/openserverless#159
2 parents 07f3600 + dac2804 commit 7b36270

32 files changed

+1000
-39
lines changed

.licenserc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ header:
5757
- 'olaris/**'
5858
- 'skip-test'
5959
- '.env.dist'
60+
- '**/ow_pod_templates.yaml'
6061

6162

6263
dependency:

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ ADD --chown=nuvolaris:nuvolaris deploy/etcd /home/nuvolaris/deploy/etcd
6969
ADD --chown=nuvolaris:nuvolaris deploy/milvus-operator /home/nuvolaris/deploy/milvus-operator
7070
ADD --chown=nuvolaris:nuvolaris deploy/milvus /home/nuvolaris/deploy/milvus
7171
ADD --chown=nuvolaris:nuvolaris deploy/milvus-slim /home/nuvolaris/deploy/milvus-slim
72+
ADD --chown=nuvolaris:nuvolaris deploy/registry /home/nuvolaris/deploy/registry
7273
ADD --chown=nuvolaris:nuvolaris quota.sh /home/nuvolaris/
7374

7475
#------------------------------------------------------------------------------

actions/devel/download/common/util.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# under the License.
1717
#
1818

19-
import mimetypes
19+
import json
2020

2121
def get_env_value(user_data, key):
2222
"""
@@ -32,4 +32,15 @@ def get_env_value(user_data, key):
3232
if env['key'] == key:
3333
return env['value']
3434

35-
return None
35+
return None
36+
37+
def is_json(value):
38+
if isinstance(value, (dict, list)): # Already a JSON-compatible structure
39+
return True
40+
if isinstance(value, str): # Try parsing if it's a string
41+
try:
42+
json.loads(value)
43+
return True
44+
except json.JSONDecodeError:
45+
return False
46+
return False

actions/devel/upload/common/util.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# under the License.
1717
#
1818

19-
import mimetypes
19+
import json
2020

2121
def get_env_value(user_data, key):
2222
"""
@@ -32,4 +32,15 @@ def get_env_value(user_data, key):
3232
if env['key'] == key:
3333
return env['value']
3434

35-
return None
35+
return None
36+
37+
def is_json(value):
38+
if isinstance(value, (dict, list)): # Already a JSON-compatible structure
39+
return True
40+
if isinstance(value, str): # Try parsing if it's a string
41+
try:
42+
json.loads(value)
43+
return True
44+
except json.JSONDecodeError:
45+
return False
46+
return False

deploy/nuvolaris-permissions/whisk-crd.yaml

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,10 @@ spec:
146146
type: boolean
147147
milvus:
148148
description: deploys Milvus Operator to support deployment of MILVUS Vector DB
149-
type: boolean
149+
type: boolean
150+
registry:
151+
description: deploys a private registry to load on the fly generated action runtimes (false by default)
152+
type: boolean
150153
required:
151154
- openwhisk
152155
- couchdb
@@ -794,7 +797,45 @@ spec:
794797
type: string
795798
collection:
796799
description: nuvolaris MILVUS collection (default to nuvolaris)
797-
type: string
800+
type: string
801+
registry:
802+
description: used to configure the internal docker compliant registry
803+
type: object
804+
properties:
805+
mode:
806+
description: deployment mode can be internal/external (default to internal)
807+
type: string
808+
volume-size:
809+
description: volume size in GB, default to 50GB
810+
type: integer
811+
auth:
812+
description: used to configure the REGISTRY user to push and pull images from
813+
type: object
814+
properties:
815+
username:
816+
type: string
817+
password:
818+
type: string
819+
required:
820+
- username
821+
- password
822+
hostname:
823+
description: used to configure the repo hostname (if set to auto and mode=internal it will be img.<apihost>)
824+
type: string
825+
ingress:
826+
description: configuration option for global REGISTRY ingresses exposure, will be taken into account only if deployment=interna
827+
type: object
828+
properties:
829+
enabled:
830+
description: boolean flag to activate a REGISTRY ingress. Default to false
831+
type: boolean
832+
required:
833+
- enabled
834+
required:
835+
- mode
836+
- volume-size
837+
- auth
838+
- hostname
798839
status:
799840
x-kubernetes-preserve-unknown-fields: true
800841
# type: object
@@ -902,4 +943,9 @@ spec:
902943
type: string
903944
priority: 0
904945
jsonPath: .status.whisk_create.milvus
905-
description: Milvus
946+
description: Milvus
947+
- name: Registry
948+
type: string
949+
priority: 0
950+
jsonPath: .status.whisk_create.registry
951+
description: Registry
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
#
18+
---
19+
apiVersion: v1
20+
kind: ConfigMap
21+
metadata:
22+
name: openwhisk-pod-templates
23+
namespace: nuvolaris
24+
data:
25+
ow_pod_templates.yaml: |
26+
apiVersion: v1
27+
kind: Pod
28+
spec:
29+
imagePullSecrets:
30+
- name: registry-pull-secret
31+
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
#
18+
---
19+
apiVersion: v1
20+
kind: ConfigMap
21+
metadata:
22+
name: openwhisk-pod-templates
23+
namespace: nuvolaris
24+
data:
25+
ow_pod_templates.yaml: |
26+
apiVersion: v1
27+
kind: Pod
28+
spec:
29+
imagePullSecrets:
30+
- name: registry-pull-secret
31+
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
#
18+
---
19+
apiVersion: v1
20+
kind: Secret
21+
metadata:
22+
name: registry-pull-secret
23+
namespace: nuvolaris
24+
type: kubernetes.io/dockerconfigjson
25+
data:
26+
.dockerconfigjson: eyJhdXRocyI6IHsibnV2b2xhcmlzLXJlZ2lzdHJ5LXN2YyI6IHsidXNlcm5hbWUiOiAib3BlbnNlcnZlcmxlc3MiLCAicGFzc3dvcmQiOiAiNHB3ZHJlZ2lzdHJ5IiwgImF1dGgiOiAiYjNCbGJuTmxjblpsY214bGMzTTZOSEIzWkhKbFoybHpkSEo1In19fQ==
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
#
18+
---
19+
apiVersion: v1
20+
data:
21+
htpasswd: bXl1c2VyOiQyeSQwNSRVWm9Tb044Q1JWc0VSaUZieVJvWWV1eTU1NGxmOTZtYWZBR1BrODJYeFppbE55bHVHa0dNbQoK
22+
kind: Secret
23+
metadata:
24+
name: registry-auth-secret
25+
namespace: nuvolaris
26+
type: Opaque
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
#
18+
---
19+
apiVersion: v1
20+
kind: PersistentVolumeClaim
21+
metadata:
22+
name: registry-pvc
23+
namespace: nuvolaris
24+
labels:
25+
app: registry-pvc
26+
spec:
27+
accessModes:
28+
- ReadWriteOnce
29+
storageClassName: standard
30+
resources:
31+
requests:
32+
storage: 10Gi

0 commit comments

Comments
 (0)