diff --git a/docker-compose.yml b/docker-compose.yml index ad5f50c..6270f20 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,8 +2,8 @@ version: '3.6' networks: is-registry-network: - haproxy-public: - external: true + #haproxy-public: + # external: true secrets: ghn-config: @@ -14,11 +14,13 @@ secrets: services: is-registry: image: d4science/gcore-is-registry + #image: is-registry-service ports: - "8080:8080" + - "3000:3000" networks: - is-registry-network - - haproxy-public + # - haproxy-public secrets: - source: ghn-config target: /home/gcube/gCore/config/GHNConfig.xml @@ -29,13 +31,13 @@ services: deploy: mode: replicated replicas: 1 - endpoint_mode: dnsrr + #endpoint_mode: dnsrr placement: - constraints: [node.role == worker] + constraints: [node.role == manager] restart_policy: condition: on-failure delay: 5s max_attempts: 5 window: 120s - logging: - driver: 'journald' + #logging: + # driver: 'journald' diff --git a/is-registry/defaults/main.yml b/is-registry/defaults/main.yml index 3772141..bc3de1b 100644 --- a/is-registry/defaults/main.yml +++ b/is-registry/defaults/main.yml @@ -1,2 +1,13 @@ --- # defaults file for is-registry +start_scopes: 'devNext' +infrastructure: 'gCube' +complete_start_scope: '/gcube/devNext' +gcore_host: 'node14-d-d4s.d4science.org' +is-registry_compose_dir: '/srv/is-registry_stack' +is-registry_docker_stack_name: 'is-registry' +is-registry_docker_service_server_name: 'is-registry' +is-registry_docker_server_image: 'd4science/gcore-is-registry' +is-registry_docker_network: 'is-registry-network' +is-registry_service_port: 8080 +is-registry_haproxy_public_net: 'haproxy-public' \ No newline at end of file diff --git a/is-registry/tasks/main.yml b/is-registry/tasks/main.yml index b34af49..40060c1 100644 --- a/is-registry/tasks/main.yml +++ b/is-registry/tasks/main.yml @@ -1,2 +1,67 @@ --- # tasks file for is-registry +- name: Create the directory where the compose file will be installed + ansible.builtin.file: + dest: '{{ is-registry_compose_dir }}' + state: directory + mode: 0750 + owner: root + group: root + +- name: Install the docker compose file + ansible.builtin.template: + src: docker-compose.yml.j2 + dest: '{{ is-registry_compose_dir }}/is-registry-docker-compose.yml' + owner: root + group: root + mode: 0400 + + +- name: Install the GHNConfig.xml + ansible.builtin.template: + src: GHNConfig.xml.j2 + dest: "{{ is-registry_compose_dir }}/GHNConfig.xml" + owner: root + group: root + mode: 0400 + +- name: Install the jndi-config.xml + ansible.builtin.template: + src: jndi-config.xml.j2 + dest: "{{ is-registry_compose_dir }}/jndi-config.xml" + owner: root + group: root + mode: 0400 + +- name: Install the server-config.wsdd + ansible.builtin.template: + src: server-config.wsdd.j2 + dest: "{{ is-registry_compose_dir }}/server-config.wsdd" + owner: root + group: root + mode: 0400 + +- name: Create the secret for GHNConfig.xml + community.docker.docker_secret: + name: ghn-config + data_src: '{{ is-registry_compose_dir }}/GHNConfig.xml' + state: present + +- name: Create the secret for jndi-config.xml + community.docker.docker_secret: + name: jndi-config + data_src: '{{ is-registry_compose_dir }}/jndi-config.xml' + state: present + +- name: Create the secret for server-config.wsdd + community.docker.docker_secret: + name: server-config + data_src: '{{ is-registry_compose_dir }}/server-config.wsdd' + state: present + +- name: Start the project stack on Docker Swarm + community.docker.docker_stack: + name: '{{ is-registry-stack }}' + state: present + compose: + - '{{ is-registry_compose_dir }}/is-registry-docker-compose.yml' \ No newline at end of file diff --git a/is-registry/templates/GHNConfig.xml.j2 b/is-registry/templates/GHNConfig.xml.j2 new file mode 100644 index 0000000..0ec2982 --- /dev/null +++ b/is-registry/templates/GHNConfig.xml.j2 @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/is-registry/templates/docker-compose.yml.j2 b/is-registry/templates/docker-compose.yml.j2 new file mode 100644 index 0000000..4c4f94c --- /dev/null +++ b/is-registry/templates/docker-compose.yml.j2 @@ -0,0 +1,47 @@ +version: '3.6' + +networks: + {{ is-registry_docker_network }}: + {{ is-registry_haproxy_public_net }}: + external: true + +secrets: + ghn-config: + external: true + jndi-config: + external: true + server-config: + external: true + +services: + {{ is-registry_docker_service_server_name }}: + image: {{ is-registry_docker_server_image }} + ports: + - "8080:8080" + - "3000:3000" + networks: + - {{ is-registry_docker_network }} + - {{ is-registry_haproxy_public_net }} + secrets: + - source: ghn-config + target: /home/gcube/gCore/config/GHNConfig.xml + mode: 0444 + - source: jndi-config + target: /home/gcube/gCore/etc/is-registry-service/jndi-config.xml + mode: 0444 + - source: server-config + target: /home/gcube/gCore/etc/globus_wsrf_core/server-config.wsdd + mode: 0444 + deploy: + mode: replicated + replicas: 1 + #endpoint_mode: dnsrr + placement: + constraints: [node.role == manager] + restart_policy: + condition: on-failure + delay: 5s + max_attempts: 5 + window: 120s + #logging: + # driver: 'journald' diff --git a/is-registry/templates/jndi-config.xml.j2 b/is-registry/templates/jndi-config.xml.j2 new file mode 100644 index 0000000..43a8e1d --- /dev/null +++ b/is-registry/templates/jndi-config.xml.j2 @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + factory + org.globus.wsrf.jndi.BeanFactory + + + resourceClass + org.gcube.informationsystem.registry.impl.state.RegistryFactoryResource + + + + + + + + + + + diff --git a/is-registry/templates/server-config.wsdd.j2 b/is-registry/templates/server-config.wsdd.j2 new file mode 100644 index 0000000..476ef35 --- /dev/null +++ b/is-registry/templates/server-config.wsdd.j2 @@ -0,0 +1,200 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + share/schema/core/notification/notification_consumer_service.wsdl + + + + + + + + + + + + share/schema/core/notification/subscription_manager_service.wsdl + + + + + + + share/schema/core/security/secconv/secure_conversation_service.wsdl + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server-config.wsdd b/server-config.wsdd new file mode 100644 index 0000000..476ef35 --- /dev/null +++ b/server-config.wsdd @@ -0,0 +1,200 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + share/schema/core/notification/notification_consumer_service.wsdl + + + + + + + + + + + + share/schema/core/notification/subscription_manager_service.wsdl + + + + + + + share/schema/core/security/secconv/secure_conversation_service.wsdl + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +