diff --git a/Makefile b/Makefile index a44227c7..2dcb978c 100644 --- a/Makefile +++ b/Makefile @@ -138,10 +138,13 @@ assign-to-ippool: kubectl annotate namespace hobbit-service "cni.projectcalico.org/ipv4pools"='[“hobbit-service"]' start-platform: - kubectl apply -f ./resource/kompose + kubectl apply -k . start-dev-platform: kubectl apply -f ./resource/kompose-dev start-elk-platform: kubectl apply -f ./resource/kompose-elk + +start-redis-service: + kubectl apply -k . diff --git a/config/db/virtuoso-ini b/config/db/virtuoso-ini new file mode 100644 index 00000000..71b4b320 --- /dev/null +++ b/config/db/virtuoso-ini @@ -0,0 +1,260 @@ +; +; virtuoso.ini +; +; Configuration file for the OpenLink Virtuoso VDBMS Server +; +; To learn more about this product, or any other product in our +; portfolio, please check out our web site at: +; +; http://virtuoso.openlinksw.com/ +; +; or contact us at: +; +; general.information@openlinksw.com +; +; If you have any technical questions, please contact our support +; staff at: +; +; technical.support@openlinksw.com +; + +; +; Database setup +; +[Database] +DatabaseFile = /opt/virtuoso-opensource/database/virtuoso.db +ErrorLogFile = /opt/virtuoso-opensource/database/virtuoso.log +LockFile = /opt/virtuoso-opensource/database/virtuoso.lck +TransactionFile = /opt/virtuoso-opensource/database/virtuoso.trx +xa_persistent_file = /opt/virtuoso-opensource/database/virtuoso.pxa +ErrorLogLevel = 7 +FileExtend = 200 +MaxCheckpointRemap = 2000 +Striping = 0 +TempStorage = TempDatabase + + +[TempDatabase] +DatabaseFile = /opt/virtuoso-opensource/database/virtuoso-temp.db +TransactionFile = /opt/virtuoso-opensource/database/virtuoso-temp.trx +MaxCheckpointRemap = 2000 +Striping = 0 + + +; +; Server parameters +; +[Parameters] +ServerPort = 1111 +LiteMode = 0 +DisableUnixSocket = 1 +DisableTcpSocket = 0 +;SSLServerPort = 2111 +;SSLCertificate = cert.pem +;SSLPrivateKey = pk.pem +;X509ClientVerify = 0 +;X509ClientVerifyDepth = 0 +;X509ClientVerifyCAFile = ca.pem +MaxClientConnections = 10 +CheckpointInterval = 60 +O_DIRECT = 0 +CaseMode = 2 +MaxStaticCursorRows = 5000 +CheckpointAuditTrail = 0 +AllowOSCalls = 0 +SchedulerInterval = 10 +DirsAllowed = ., /opt/virtuoso-opensource/vad +ThreadCleanupInterval = 0 +ThreadThreshold = 10 +ResourcesCleanupInterval = 0 +FreeTextBatchSize = 100000 +SingleCPU = 0 +VADInstallDir = /opt/virtuoso-opensource/vad/ +PrefixResultNames = 0 +RdfFreeTextRulesSize = 100 +IndexTreeMaps = 256 +MaxMemPoolSize = 200000000 +PrefixResultNames = 0 +MacSpotlight = 0 +IndexTreeMaps = 64 +MaxQueryMem = 2G ; memory allocated to query processor +VectorSize = 1000 ; initial parallel query vector (array of query operations) size +MaxVectorSize = 1000000 ; query vector size threshold. +AdjustVectorSize = 0 +ThreadsPerQuery = 4 +AsyncQueueMaxThreads = 10 +;; +;; When running with large data sets, one should configure the Virtuoso +;; process to use between 2/3 to 3/5 of free system memory and to stripe +;; storage on all available disks. +;; +;; Uncomment next two lines if there is 2 GB system memory free +;NumberOfBuffers = 170000 +;MaxDirtyBuffers = 130000 +;; Uncomment next two lines if there is 4 GB system memory free +;NumberOfBuffers = 340000 +; MaxDirtyBuffers = 250000 +;; Uncomment next two lines if there is 8 GB system memory free +;NumberOfBuffers = 680000 +;MaxDirtyBuffers = 500000 +;; Uncomment next two lines if there is 16 GB system memory free +;NumberOfBuffers = 1360000 +;MaxDirtyBuffers = 1000000 +;; Uncomment next two lines if there is 32 GB system memory free +;NumberOfBuffers = 2720000 +;MaxDirtyBuffers = 2000000 +;; Uncomment next two lines if there is 48 GB system memory free +;NumberOfBuffers = 4000000 +;MaxDirtyBuffers = 3000000 +;; Uncomment next two lines if there is 64 GB system memory free +;NumberOfBuffers = 5450000 +;MaxDirtyBuffers = 4000000 +;; +;; Note the default settings will take very little memory +;; but will not result in very good performance +;; +NumberOfBuffers = 10000 +MaxDirtyBuffers = 6000 + + +[HTTPServer] +ServerPort = 8890 +ServerRoot = /opt/virtuoso-opensource/vsp +MaxClientConnections = 10 +DavRoot = DAV +EnabledDavVSP = 0 +HTTPProxyEnabled = 0 +TempASPXDir = 0 +DefaultMailServer = localhost:25 +ServerThreads = 10 +MaxKeepAlives = 10 +KeepAliveTimeout = 10 +MaxCachedProxyConnections = 10 +ProxyConnectionCacheTimeout = 15 +HTTPThreadSize = 280000 +HttpPrintWarningsInOutput = 0 +Charset = UTF-8 +;HTTPLogFile = logs/http.log +MaintenancePage = atomic.html +EnabledGzipContent = 1 + + +[AutoRepair] +BadParentLinks = 0 + +[Client] +SQL_PREFETCH_ROWS = 100 +SQL_PREFETCH_BYTES = 16000 +SQL_QUERY_TIMEOUT = 0 +SQL_TXN_TIMEOUT = 0 +;SQL_NO_CHAR_C_ESCAPE = 1 +;SQL_UTF8_EXECS = 0 +;SQL_NO_SYSTEM_TABLES = 0 +;SQL_BINARY_TIMESTAMP = 1 +;SQL_ENCRYPTION_ON_PASSWORD = -1 + +[VDB] +ArrayOptimization = 0 +NumArrayParameters = 10 +VDBDisconnectTimeout = 1000 +KeepConnectionOnFixedThread = 0 + +[Replication] +ServerName = db-INSPIRO +ServerEnable = 1 +QueueMax = 50000 + + +; +; Striping setup +; +; These parameters have only effect when Striping is set to 1 in the +; [Database] section, in which case the DatabaseFile parameter is ignored. +; +; With striping, the database is spawned across multiple segments +; where each segment can have multiple stripes. +; +; Format of the lines below: +; Segment = , [, .. ] +; +; must be ordered from 1 up. +; +; The is the total size of the segment which is equally divided +; across all stripes forming the segment. Its specification can be in +; gigabytes (g), megabytes (m), kilobytes (k) or in database blocks +; (b, the default) +; +; Note that the segment size must be a multiple of the database page size +; which is currently 8k. Also, the segment size must be divisible by the +; number of stripe files forming the segment. +; +; The example below creates a 200 meg database striped on two segments +; with two stripes of 50 meg and one of 100 meg. +; +; You can always add more segments to the configuration, but once +; added, do not change the setup. +; +[Striping] +Segment1 = 100M, db-seg1-1.db, db-seg1-2.db +Segment2 = 100M, db-seg2-1.db +;... + +;[TempStriping] +;Segment1 = 100M, db-seg1-1.db, db-seg1-2.db +;Segment2 = 100M, db-seg2-1.db +;... + +;[Ucms] +;UcmPath = +;Ucm1 = +;Ucm2 = +;... + + +[Zero Config] +ServerName = virtuoso (INSPIRO) +;ServerDSN = ZDSN +;SSLServerName = +;SSLServerDSN = + + +[Mono] +;MONO_TRACE = Off +;MONO_PATH = +;MONO_ROOT = +;MONO_CFG_DIR = +;virtclr.dll = + + +[URIQA] +DynamicLocal = 0 +DefaultHost = localhost:8890 + + +[SPARQL] +;ExternalQuerySource = 1 +;ExternalXsltSource = 1 +;DefaultGraph = http://localhost:8890/dataspace +;ImmutableGraphs = http://localhost:8890/dataspace +ResultSetMaxRows = 10000 +MaxQueryCostEstimationTime = 400 ; in seconds +MaxQueryExecutionTime = 60 ; in seconds +DefaultQuery = select distinct ?Concept where {[] a ?Concept} LIMIT 100 +DeferInferenceRulesInit = 0 ; controls inference rules loading +;PingService = http://rpc.pingthesemanticweb.com/ + + +[Plugins] +LoadPath = /opt/virtuoso-opensource/hosting +;Load1 = plain, wikiv +;Load2 = plain, mediawiki +;Load3 = plain, creolewiki +;Load4 = plain, im +;Load5 = plain, wbxml2 +;Load6 = plain, hslookup +;Load7 = attach, libphp5.so +;Load8 = Hosting, hosting_php.so +;Load9 = Hosting,hosting_perl.so +;Load10 = Hosting,hosting_python.so +;Load11 = Hosting,hosting_ruby.so +;Load12 = msdtc,msdtc_sample diff --git a/config/redis-db/.gitignore b/config/redis-db/.gitignore index a424d008..4c04b62f 100644 --- a/config/redis-db/.gitignore +++ b/config/redis-db/.gitignore @@ -3,3 +3,4 @@ # Except this file !.gitignore !redis.conf +!redis-conf diff --git a/config/redis-db/redis-conf b/config/redis-db/redis-conf new file mode 100644 index 00000000..43f44ed5 --- /dev/null +++ b/config/redis-db/redis-conf @@ -0,0 +1,5 @@ +appendonly yes +appendfsync always +save 60 100 +save 360 10 +save 3600 1 diff --git a/kustomization.yaml b/kustomization.yaml new file mode 100644 index 00000000..71dce917 --- /dev/null +++ b/kustomization.yaml @@ -0,0 +1,12 @@ +configMapGenerator: +- name: redis-server + files: + - config/redis-db/redis-config +- name: vos-server + files: + - config/db/virtuoso-ini +resources: +- resource/redis.yaml +- resource/vos.yaml +- resource/keycloak.yaml +- resource/rabbit.yaml diff --git a/resource/calico.yaml b/resource/calico.yaml index 99b33e8a..b209cdbf 100644 --- a/resource/calico.yaml +++ b/resource/calico.yaml @@ -3746,5 +3746,3 @@ metadata: --- # Source: calico/templates/configure-canal.yaml - - diff --git a/resource/hobbit-core-networkpolicy.yaml b/resource/hobbit-core-networkpolicy.yaml new file mode 100644 index 00000000..f0eafb36 --- /dev/null +++ b/resource/hobbit-core-networkpolicy.yaml @@ -0,0 +1,23 @@ +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + creationTimestamp: null + name: hobbit-core +spec: + policyTypes: + - Ingress + - Egress + ingress: + - from: + - podSelector: + matchLabels: + io.kompose.network/hobbit-core: hobbit-core + egress: + - to: + - podSelector: + matchLabels: + io.kompose.network/hobbit-core: hobbit-core + podSelector: + matchLabels: + io.kompose.network/hobbit-core: hobbit-core + diff --git a/resource/hobbit-networkpolicy.yaml b/resource/hobbit-networkpolicy.yaml new file mode 100644 index 00000000..75bd4ae5 --- /dev/null +++ b/resource/hobbit-networkpolicy.yaml @@ -0,0 +1,22 @@ +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + creationTimestamp: null + name: hobbit +spec: + policyTypes: + - Ingress + - Egress + ingress: + - from: + - podSelector: + matchLabels: + io.kompose.network/hobbit: hobbit + egress: + - to: + - podSelector: + matchLabels: + io.kompose.network/hobbit: hobbit + podSelector: + matchLabels: + io.kompose.network/hobbit: hobbit diff --git a/resource/kompose/keycloak.yaml b/resource/keycloak.yaml similarity index 95% rename from resource/kompose/keycloak.yaml rename to resource/keycloak.yaml index 32618b41..d60ee052 100644 --- a/resource/kompose/keycloak.yaml +++ b/resource/keycloak.yaml @@ -4,6 +4,7 @@ metadata: name: keycloak labels: app: keycloak + io.kompose.network/hobbit: "true" annotations: "cni.projectcalico.org/ipv4pools": "[\"hobbit\"]" spec: @@ -15,6 +16,7 @@ spec: metadata: labels: app: keycloak + io.kompose.network/hobbit: "true" annotations: "cni.projectcalico.org/ipv4pools": "[\"hobbit\"]" spec: diff --git a/resource/kompose-dev/analysis-deployment.yaml b/resource/kompose-dev/analysis-deployment.yaml deleted file mode 100644 index cef15e3d..00000000 --- a/resource/kompose-dev/analysis-deployment.yaml +++ /dev/null @@ -1,30 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - io.kompose.service: analysis - name: analysis -spec: - replicas: 1 - selector: - matchLabels: - io.kompose.service: analysis - strategy: {} - template: - metadata: - labels: - io.kompose.network/hobbit-core: "true" - io.kompose.service: analysis - spec: - containers: - - env: - - name: HOBBIT_RABBIT_HOST - value: rabbit - image: hobbitproject/hobbit-analysis-component:dev - imagePullPolicy: IfNotPresent - name: analysis - resources: {} - restartPolicy: Always - serviceAccountName: "" - volumes: null -status: {} diff --git a/resource/kompose-dev/analysis.yaml b/resource/kompose-dev/analysis.yaml new file mode 100644 index 00000000..f85c4467 --- /dev/null +++ b/resource/kompose-dev/analysis.yaml @@ -0,0 +1,27 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: analysis + labels: + app: analysis + annotations: + "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\"]" +spec: + replicas: 1 + selector: + matchLabels: + app: analysis + template: + metadata: + labels: + app: analysis + annotations: + "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\"]" + spec: + containers: + - name: analysis + image: hobbitproject/hobbit-analysis-component:dev + imagePullPolicy: IfNotPresent + env: + - name: HOBBIT_RABBIT_HOST + value: "rabbit" diff --git a/resource/kompose-dev/gui-deployment.yaml b/resource/kompose-dev/gui-deployment.yaml deleted file mode 100644 index 3a5f9889..00000000 --- a/resource/kompose-dev/gui-deployment.yaml +++ /dev/null @@ -1,44 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - io.kompose.service: gui - name: gui - namespace: hobbit -spec: - replicas: 1 - selector: - matchLabels: - io.kompose.service: gui - strategy: {} - template: - metadata: - labels: - io.kompose.network/hobbit: "true" - io.kompose.network/hobbit-core: "true" - io.kompose.service: gui - spec: - containers: - - env: - - name: CHECK_REALM_URL - value: "false" - - name: ELASTICSEARCH_HOST - value: elasticsearch - - name: ELASTICSEARCH_HTTP_PORT - value: "9200" - - name: HOBBIT_RABBIT_HOST - value: rabbit - - name: KEYCLOAK_AUTH_URL - value: http://localhost:8181/auth - - name: KEYCLOAK_DIRECT_URL - value: http://keycloak:8080/auth - image: hobbitproject/hobbit-gui:dev - imagePullPolicy: IfNotPresent - name: gui - ports: - - containerPort: 8080 - resources: {} - restartPolicy: Always - serviceAccountName: "" - volumes: null -status: {} diff --git a/resource/kompose-dev/gui-service.yaml b/resource/kompose-dev/gui-service.yaml deleted file mode 100644 index 1cd543a0..00000000 --- a/resource/kompose-dev/gui-service.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: - io.kompose.service: gui - name: gui - namespace: hobbit -spec: - ports: - - name: "8080" - port: 8080 - targetPort: 8080 - selector: - io.kompose.service: gui -status: - loadBalancer: {} diff --git a/resource/kompose-dev/gui.yaml b/resource/kompose-dev/gui.yaml new file mode 100644 index 00000000..43fefbcf --- /dev/null +++ b/resource/kompose-dev/gui.yaml @@ -0,0 +1,56 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: gui + labels: + app: gui + annotations: + "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\",\"hobbit\"]" +spec: + replicas: 1 + selector: + matchLabels: + app: gui + template: + metadata: + labels: + app: gui + annotations: + "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\",\"hobbit\"]" + spec: + containers: + - name: gui + image: hobbitproject/hobbit-gui:dev + imagePullPolicy: IfNotPresent + env: + - name: HOBBIT_RABBIT_HOST + value: "rabbit" + - name: KEYCLOAK_AUTH_URL + value: "http://localhost:8181/auth" + - name: CHECK_REALM_URL + value: "false" + - name: KEYCLOAK_DIRECT_URL + value: "http://keycloak:8080/auth" + - name: ELASTICSEARCH_HOST + value: "elasticsearch" + - name: ELASTICSEARCH_HTTP_PORT + value: "9200" + ports: + - containerPort: 8080 + +--- + +apiVersion: v1 +kind: Service +metadata: + name: gui + labels: + app: gui + annotations: + "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\",\"hobbit\"]" +spec: + ports: + - port: 8080 + protocol: TCP + selector: + app: gui diff --git a/resource/kompose-dev/keycloak-claim0-persistentvolumeclaim.yaml b/resource/kompose-dev/keycloak-claim0-persistentvolumeclaim.yaml deleted file mode 100644 index 9234f4a1..00000000 --- a/resource/kompose-dev/keycloak-claim0-persistentvolumeclaim.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - creationTimestamp: null - labels: - io.kompose.service: keycloak-claim0 - name: keycloak-claim0 -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 100Mi -status: {} diff --git a/resource/kompose-dev/keycloak-deployment.yaml b/resource/kompose-dev/keycloak-deployment.yaml deleted file mode 100644 index f0f75091..00000000 --- a/resource/kompose-dev/keycloak-deployment.yaml +++ /dev/null @@ -1,37 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - io.kompose.service: keycloak - name: keycloak - namespace: hobbit -spec: - replicas: 1 - selector: - matchLabels: - io.kompose.service: keycloak - strategy: - type: Recreate - template: - metadata: - labels: - io.kompose.network/hobbit: "true" - io.kompose.service: keycloak - spec: - containers: - - image: hobbitproject/hobbit-keycloak:latest - imagePullPolicy: IfNotPresent - name: keycloak - ports: - - containerPort: 8080 - resources: {} - volumeMounts: - - mountPath: /opt/jboss/keycloak/standalone/data/db - name: keycloak-claim0 - restartPolicy: Always - serviceAccountName: "" - volumes: - - name: keycloak-claim0 - persistentVolumeClaim: - claimName: keycloak-claim0 -status: {} diff --git a/resource/kompose-dev/keycloak-service.yaml b/resource/kompose-dev/keycloak-service.yaml deleted file mode 100644 index 0fd862e3..00000000 --- a/resource/kompose-dev/keycloak-service.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: - io.kompose.service: keycloak - name: keycloak - namespace: hobbit -spec: - ports: - - name: "8181" - port: 8181 - targetPort: 8080 - selector: - io.kompose.service: keycloak -status: - loadBalancer: {} diff --git a/resource/kompose-dev/node-exporter-deployment.yaml b/resource/kompose-dev/node-exporter-deployment.yaml deleted file mode 100644 index 24ee8cc2..00000000 --- a/resource/kompose-dev/node-exporter-deployment.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - io.kompose.service: node-exporter - name: node-exporter -spec: - replicas: 1 - selector: - matchLabels: - io.kompose.service: node-exporter - strategy: {} - template: - metadata: - labels: - io.kompose.network/hobbit-core: "true" - io.kompose.service: node-exporter - spec: - containers: - - image: prom/node-exporter - imagePullPolicy: IfNotPresent - name: node-exporter - resources: {} - restartPolicy: Always - serviceAccountName: "" - volumes: null -status: {} diff --git a/resource/kompose-dev/node-exporter.yaml b/resource/kompose-dev/node-exporter.yaml new file mode 100644 index 00000000..2317ff75 --- /dev/null +++ b/resource/kompose-dev/node-exporter.yaml @@ -0,0 +1,24 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: node-exporter + labels: + app: node-exporter + annotations: + "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\"]" +spec: + replicas: 1 + selector: + matchLabels: + app: node-exporter + template: + metadata: + labels: + app: node-exporter + annotations: + "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\"]" + spec: + containers: + - name: node-exporter + image: prom/node-exporter + imagePullPolicy: IfNotPresent diff --git a/resource/kompose-dev/platform-controller-claim0-persistentvolumeclaim.yaml b/resource/kompose-dev/platform-controller-claim0-persistentvolumeclaim.yaml deleted file mode 100644 index 80aeb30a..00000000 --- a/resource/kompose-dev/platform-controller-claim0-persistentvolumeclaim.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - creationTimestamp: null - labels: - io.kompose.service: platform-controller-claim0 - name: platform-controller-claim0 -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 100Mi -status: {} diff --git a/resource/kompose-dev/platform-controller-deployment.yaml b/resource/kompose-dev/platform-controller-deployment.yaml deleted file mode 100644 index ac17e0e3..00000000 --- a/resource/kompose-dev/platform-controller-deployment.yaml +++ /dev/null @@ -1,54 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - io.kompose.service: platform-controller - name: platform-controller -spec: - replicas: 1 - selector: - matchLabels: - io.kompose.service: platform-controller - strategy: - type: Recreate - template: - metadata: - labels: - io.kompose.network/hobbit-core: "true" - io.kompose.service: platform-controller - spec: - containers: - - env: - - name: DEPLOY_ENV - value: testing - - name: GITLAB_EMAIL - - name: GITLAB_TOKEN - - name: GITLAB_USER - - name: HOBBIT_RABBIT_EXPERIMENTS_HOST - value: rabbit - - name: HOBBIT_RABBIT_HOST - value: rabbit - - name: HOBBIT_REDIS_HOST - value: redis - - name: LOGGING_GELF_ADDRESS - value: udp://localhost:12201 - - name: PROMETHEUS_HOST - value: prometheus - - name: PROMETHEUS_PORT - value: "9090" - - name: SWARM_NODE_NUMBER - value: "1" - image: hobbitproject/hobbit-platform-controller:dev - imagePullPolicy: IfNotPresent - name: platform-controller - resources: {} - volumeMounts: - - mountPath: /var/run/docker.sock - name: platform-controller-claim0 - restartPolicy: Always - serviceAccountName: "" - volumes: - - name: platform-controller-claim0 - persistentVolumeClaim: - claimName: platform-controller-claim0 -status: {} diff --git a/resource/kompose-dev/platform-controller.yaml b/resource/kompose-dev/platform-controller.yaml new file mode 100644 index 00000000..213aef68 --- /dev/null +++ b/resource/kompose-dev/platform-controller.yaml @@ -0,0 +1,54 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: platform-controller + labels: + app: platform-controller + annotations: + "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\"]" +spec: + replicas: 1 + selector: + matchLabels: + app: platform-controller + template: + metadata: + labels: + app: platform-controller + annotations: + "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\"]" + spec: + containers: + - name: platform-controller + image: hobbitproject/hobbit-platform-controller:dev + imagePullPolicy: IfNotPresent + env: + - name: HOBBIT_RABBIT_HOST + value: "rabbit" + - name: HOBBIT_RABBIT_EXPERIMENTS_HOST + value: "rabbit" + - name: HOBBIT_REDIS_HOST + value: "redis" + - name: DEPLOY_ENV + value: "testing" + - name: GITLAB_USER + value: "${GITLAB_USER}" + - name: GITLAB_EMAIL + value: "${GITLAB_EMAIL}" + - name: GITLAB_TOKEN + value: "${GITLAB_TOKEN}" + - name: LOGGING_GELF_ADDRESS + value: "udp://localhost:12201" + - name: SWARM_NODE_NUMBER + value: "1" + - name: PROMETHEUS_HOST + value: "prometheus" + - name: PROMETHEUS_PORT + value: "9090" + volumeMounts: + - name: dockersock + mountPath: "/var/run/docker.sock" + volumes: + - name: dockersock + hostPath: + path: /var/run/docker.sock diff --git a/resource/kompose-dev/rabbit-deployment.yaml b/resource/kompose-dev/rabbit-deployment.yaml deleted file mode 100644 index fc807b22..00000000 --- a/resource/kompose-dev/rabbit-deployment.yaml +++ /dev/null @@ -1,32 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - io.kompose.service: rabbit - name: rabbit - namespace: hobbit -spec: - replicas: 1 - selector: - matchLabels: - io.kompose.service: rabbit - strategy: {} - template: - metadata: - labels: - io.kompose.network/hobbit: "true" - io.kompose.network/hobbit-core: "true" - io.kompose.service: rabbit - spec: - containers: - - image: rabbitmq:management - imagePullPolicy: IfNotPresent - name: rabbit - ports: - - containerPort: 15672 - - containerPort: 5672 - resources: {} - restartPolicy: Always - serviceAccountName: "" - volumes: null -status: {} diff --git a/resource/kompose-dev/rabbit-service.yaml b/resource/kompose-dev/rabbit-service.yaml deleted file mode 100644 index d69898df..00000000 --- a/resource/kompose-dev/rabbit-service.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: - io.kompose.service: rabbit - name: rabbit - namespace: hobbit -spec: - ports: - - name: "8081" - port: 8081 - targetPort: 15672 - - name: "5672" - port: 5672 - targetPort: 5672 - selector: - io.kompose.service: rabbit -status: - loadBalancer: {} diff --git a/resource/kompose-dev/redis-claim0-persistentvolumeclaim.yaml b/resource/kompose-dev/redis-claim0-persistentvolumeclaim.yaml deleted file mode 100644 index d552d346..00000000 --- a/resource/kompose-dev/redis-claim0-persistentvolumeclaim.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - creationTimestamp: null - labels: - io.kompose.service: redis-claim0 - name: redis-claim0 -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 100Mi -status: {} diff --git a/resource/kompose-dev/redis-deployment.yaml b/resource/kompose-dev/redis-deployment.yaml deleted file mode 100644 index c3eb0485..00000000 --- a/resource/kompose-dev/redis-deployment.yaml +++ /dev/null @@ -1,39 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - io.kompose.service: redis - name: redis -spec: - replicas: 1 - selector: - matchLabels: - io.kompose.service: redis - strategy: - type: Recreate - template: - metadata: - labels: - io.kompose.network/hobbit-core: "true" - io.kompose.service: redis - spec: - containers: - - args: - - redis-server - - /data/redis.conf - image: redis:4.0.7 - imagePullPolicy: IfNotPresent - name: redis - ports: - - containerPort: 6379 - resources: {} - volumeMounts: - - mountPath: /data - name: redis-claim0 - restartPolicy: Always - serviceAccountName: "" - volumes: - - name: redis-claim0 - persistentVolumeClaim: - claimName: redis-claim0 -status: {} diff --git a/resource/kompose-dev/redis-service.yaml b/resource/kompose-dev/redis-service.yaml deleted file mode 100644 index 702eaab0..00000000 --- a/resource/kompose-dev/redis-service.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: - io.kompose.service: redis - name: redis -spec: - ports: - - name: "6379" - port: 6379 - targetPort: 6379 - selector: - io.kompose.service: redis -status: - loadBalancer: {} diff --git a/resource/kompose-dev/storage-service-deployment.yaml b/resource/kompose-dev/storage-service-deployment.yaml deleted file mode 100644 index d5c060e0..00000000 --- a/resource/kompose-dev/storage-service-deployment.yaml +++ /dev/null @@ -1,36 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - io.kompose.service: storage-service - name: storage-service -spec: - replicas: 1 - selector: - matchLabels: - io.kompose.service: storage-service - strategy: {} - template: - metadata: - labels: - io.kompose.network/hobbit-core: "true" - io.kompose.service: storage-service - spec: - containers: - - env: - - name: HOBBIT_RABBIT_HOST - value: rabbit - - name: SPARQL_ENDPOINT_PASSWORD - value: Password - - name: SPARQL_ENDPOINT_URL - value: http://vos:8890/sparql - - name: SPARQL_ENDPOINT_USERNAME - value: HobbitPlatform - image: hobbitproject/hobbit-storage-service:dev - imagePullPolicy: IfNotPresent - name: storage-service - resources: {} - restartPolicy: Always - serviceAccountName: "" - volumes: null -status: {} diff --git a/resource/kompose-dev/storage-service.yaml b/resource/kompose-dev/storage-service.yaml new file mode 100644 index 00000000..3c44b82b --- /dev/null +++ b/resource/kompose-dev/storage-service.yaml @@ -0,0 +1,33 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: storage-service + labels: + app: storage-service + annotations: + "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\"]" +spec: + replicas: 1 + selector: + matchLabels: + app: storage-service + template: + metadata: + labels: + app: storage-service + annotations: + "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\"]" + spec: + containers: + - name: storage-service + image: hobbitproject/hobbit-storage-service:dev + imagePullPolicy: IfNotPresent + env: + - name: SPARQL_ENDPOINT_URL + value: "http://vos:8890/sparql" + - name: HOBBIT_RABBIT_HOST + value: "rabbit" + - name: SPARQL_ENDPOINT_USERNAME + value: "HobbitPlatform" + - name: SPARQL_ENDPOINT_PASSWORD + value: "Password" diff --git a/resource/kompose-dev/vos-claim0-persistentvolumeclaim.yaml b/resource/kompose-dev/vos-claim0-persistentvolumeclaim.yaml deleted file mode 100644 index 1b2e8325..00000000 --- a/resource/kompose-dev/vos-claim0-persistentvolumeclaim.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - creationTimestamp: null - labels: - io.kompose.service: vos-claim0 - name: vos-claim0 -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 100Mi -status: {} diff --git a/resource/kompose-dev/vos-deployment.yaml b/resource/kompose-dev/vos-deployment.yaml deleted file mode 100644 index b1eed453..00000000 --- a/resource/kompose-dev/vos-deployment.yaml +++ /dev/null @@ -1,37 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - io.kompose.service: vos - name: vos -spec: - replicas: 1 - selector: - matchLabels: - io.kompose.service: vos - strategy: - type: Recreate - template: - metadata: - labels: - io.kompose.network/hobbit-core: "true" - io.kompose.service: vos - spec: - containers: - - image: hobbitproject/virtuoso_opensource:v07.20.3217 - imagePullPolicy: IfNotPresent - name: vos - ports: - - containerPort: 8890 - resources: {} - volumeMounts: - - mountPath: /opt/virtuoso-opensource/database - name: vos-claim0 - hostname: vos - restartPolicy: Always - serviceAccountName: "" - volumes: - - name: vos-claim0 - persistentVolumeClaim: - claimName: vos-claim0 -status: {} diff --git a/resource/kompose-dev/vos-service.yaml b/resource/kompose-dev/vos-service.yaml deleted file mode 100644 index 9311d032..00000000 --- a/resource/kompose-dev/vos-service.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: - io.kompose.service: vos - name: vos -spec: - ports: - - name: "8890" - port: 8890 - targetPort: 8890 - selector: - io.kompose.service: vos -status: - loadBalancer: {} diff --git a/resource/kompose/gui.yaml b/resource/kompose/gui.yaml index ba6631b6..74daa007 100644 --- a/resource/kompose/gui.yaml +++ b/resource/kompose/gui.yaml @@ -4,6 +4,8 @@ metadata: name: gui labels: app: gui + io.kompose.network/hobbit: hobbit + io.kompose.network/hobbit-core: hobbit-core annotations: "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\",\"hobbit\"]" spec: @@ -15,6 +17,8 @@ spec: metadata: labels: app: gui + io.kompose.network/hobbit: hobbit + io.kompose.network/hobbit-core: hobbit-core annotations: "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\",\"hobbit\"]" spec: diff --git a/resource/kompose/hobbit-core-networkpolicy.yaml b/resource/kompose/hobbit-core-networkpolicy.yaml deleted file mode 100644 index 5991b1e9..00000000 --- a/resource/kompose/hobbit-core-networkpolicy.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: NetworkPolicy -metadata: - creationTimestamp: null - name: hobbit-core - namespace: hobbit-core -spec: - policyTypes: - - Ingress - - Egress - ingress: - - from: - - ipBlock: - cidr: 172.16.101.0/24 - - podSelector: - matchLabels: - io.kompose.network/hobbit-core: "true" - podSelector: - matchLabels: - io.kompose.network/hobbit-core: "true" diff --git a/resource/kompose/hobbit-networkpolicy.yaml b/resource/kompose/hobbit-networkpolicy.yaml deleted file mode 100644 index c55528ee..00000000 --- a/resource/kompose/hobbit-networkpolicy.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: NetworkPolicy -metadata: - creationTimestamp: null - name: hobbit -spec: - policyTypes: - - Ingress - - Egress - ingress: - - from: - - ipBlock: - cidr: 172.16.100.0/24 - - podSelector: - matchLabels: - io.kompose.network/hobbit: "true" - podSelector: - matchLabels: - io.kompose.network/hobbit: "true" diff --git a/resource/kompose/storage-service.yaml b/resource/kompose/storage-service.yaml index edf162d2..297c8465 100644 --- a/resource/kompose/storage-service.yaml +++ b/resource/kompose/storage-service.yaml @@ -31,4 +31,3 @@ spec: value: "HobbitPlatform" - name: SPARQL_ENDPOINT_PASSWORD value: "Password" - diff --git a/resource/pools.yaml b/resource/pools.yaml index 9360580d..690a06bf 100644 --- a/resource/pools.yaml +++ b/resource/pools.yaml @@ -1,4 +1,4 @@ -apiVersion: crd.projectcalico.org/v1 +apiVersion: projectcalico.org/v3 kind: IPPool metadata: name: hobbit @@ -11,7 +11,7 @@ spec: --- -apiVersion: crd.projectcalico.org/v1 +apiVersion: projectcalico.org/v3 kind: IPPool metadata: name: hobbit-core @@ -24,7 +24,7 @@ spec: --- -apiVersion: crd.projectcalico.org/v1 +apiVersion: projectcalico.org/v3 kind: IPPool metadata: name: hobbit-services diff --git a/resource/kompose/rabbit.yaml b/resource/rabbit.yaml similarity index 85% rename from resource/kompose/rabbit.yaml rename to resource/rabbit.yaml index ddb81611..6f3252d2 100644 --- a/resource/kompose/rabbit.yaml +++ b/resource/rabbit.yaml @@ -4,6 +4,8 @@ metadata: name: rabbit labels: app: rabbit + io.kompose.network/hobbit: hobbit + io.kompose.network/hobbit-core: hobbit-core annotations: "cni.projectcalico.org/ipv4pools": "[\"hobbit\",\"hobbit-core\"]" spec: @@ -15,6 +17,8 @@ spec: metadata: labels: app: rabbit + io.kompose.network/hobbit: hobbit + io.kompose.network/hobbit-core: hobbit-core annotations: "cni.projectcalico.org/ipv4pools": "[\"hobbit\",\"hobbit-core\"]" spec: diff --git a/resource/kompose/redis.yaml b/resource/redis.yaml similarity index 55% rename from resource/kompose/redis.yaml rename to resource/redis.yaml index 9654dc3c..8ca343dc 100644 --- a/resource/kompose/redis.yaml +++ b/resource/redis.yaml @@ -4,6 +4,7 @@ metadata: name: redis labels: app: redis + io.kompose.network/hobbit-core: hobbit-core annotations: "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\"]" spec: @@ -15,20 +16,26 @@ spec: metadata: labels: app: redis + io.kompose.network/hobbit-core: hobbit-core annotations: "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\"]" spec: + securityContext: + runAsUser: 0 containers: - name: redis image: redis:4.0.7 imagePullPolicy: IfNotPresent + securityContext: + allowPrivilegeEscalation: false + runAsUser: 0 volumeMounts: - - name: redis-server - mountPath: "/data" - command: - - redis-server - - "/data/redis.conf" + - mountPath: /config/redis-db + name: redis-server volumes: - name: redis-server - hostPath: - path: /config/redis-db + configMap: + name: redis-server + items: + - key: redis-config + path: redis.conf diff --git a/resource/kompose/vos.yaml b/resource/vos.yaml similarity index 68% rename from resource/kompose/vos.yaml rename to resource/vos.yaml index 392c9e77..1bdb1f96 100644 --- a/resource/kompose/vos.yaml +++ b/resource/vos.yaml @@ -4,6 +4,7 @@ metadata: name: vos labels: app: vos + io.kompose.network/hobbit-core: hobbit-core annotations: "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\"]" spec: @@ -15,6 +16,7 @@ spec: metadata: labels: app: vos + io.kompose.network/hobbit-core: hobbit-core annotations: "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\"]" spec: @@ -23,18 +25,21 @@ spec: image: hobbitproject/virtuoso_opensource:v07.20.3217 imagePullPolicy: IfNotPresent securityContext: - privileged: true - allowPrivilegeEscalation: true + allowPrivilegeEscalation: false + runAsUser: 0 ports: - name: http containerPort: 8890 volumeMounts: - - name: db - mountPath: "/opt/virtuoso-opensource/database" + - mountPath: /config/db + name: vos-server volumes: - - name: db - hostPath: - path: /config/db + - name: vos-server + configMap: + name: vos-server + items: + - key: virtuoso-ini + path: virtuoso.ini --- diff --git a/run-storage-init.sh b/run-storage-init.sh index d78c1dee..2e82e9c0 100755 --- a/run-storage-init.sh +++ b/run-storage-init.sh @@ -1,11 +1,14 @@ #!/bin/bash # Runs the initialization script for the Storage of the HOBBIT Platform. -VOS_CONTAINER_ID=$(docker ps -aqf "name=vos") -VOS_CONTAINER_NUMBER=$(docker ps -aqf "name=vos" | wc -l) -if [ "$VOS_CONTAINER_NUMBER" -eq "1" ]; then - docker exec -it $VOS_CONTAINER_ID bash ./storage-init.sh -else - echo "Can not determine vos container name..." - echo "Use docker ps to determine vos container name and execute the following command manually:" - echo "docker exec -it yourvoscontainername bash ./storage-init.sh" -fi +#VOS_CONTAINER_ID=$(docker ps -aqf "name=vos") +#VOS_CONTAINER_NUMBER=$(docker ps -aqf "name=vos" | wc -l) +#if [ "$VOS_CONTAINER_NUMBER" -eq "1" ]; then +# docker exec -it $VOS_CONTAINER_ID bash ./storage-init.sh +#else +# echo "Can not determine vos container name..." +# echo "Use docker ps to determine vos container name and execute the following command manually:" +# echo "docker exec -it yourvoscontainername bash ./storage-init.sh" +#fi +VOS_CONTAINER_ID=$(kubectl get pod -l app=vos -o jsonpath="{.items[0].metadata.name}") +echo $VOS_CONTAINER_ID; +kubectl exec -it $VOS_CONTAINER_ID -- bash -c "./storage-init.sh"