From ec4257ab3be31228629af7ecb1dbebbf69515f39 Mon Sep 17 00:00:00 2001
From: Fabio Santaniello <fabio.santaniello@epfl.ch>
Date: Thu, 10 Feb 2022 14:06:43 +0100
Subject: [PATCH 1/3] new scipion install - core only

---
 tasks/main.yml | 231 +++++--------------------------------------------
 1 file changed, 21 insertions(+), 210 deletions(-)

diff --git a/tasks/main.yml b/tasks/main.yml
index 2f6aa32..464e7bb 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -1,226 +1,37 @@
 ---
 # tasks file for Scipion
 
-- name: update ubuntu
-  become: yes
-  package:
-    update_cache: yes
-    upgrade: yes
+##!!! depends on conda!!
 
 - name: install Scipion requirements
   become: yes
   apt:
     state: latest
     pkg:
-      - openjdk-8-jdk
-      - libopenmpi-dev
-      - openmpi-bin
-      - gfortran
-      - libxft2
-      - libxss1
-      - gcc-5
-      - g++-5
-      - cmake
-      - openjdk-8-jdk
-      - libxft-dev
-      - libssl-dev
-      - libxext-dev
-      - libxml2-dev
-      - libreadline-dev
-      - libquadmath0
-      - libxslt1-dev
+      - gcc-8
+      - g++-8
       - libopenmpi-dev
-      - openmpi-bin
-      - libxss-dev
-      - libgsl0-dev
-      - libx11-dev
-      - gfortran
-      - libfreetype6-dev
-      - scons
-      - libfftw3-dev
-      - libopencv-dev
-      - curl
-      - git
-      - unzip
-      - nmon
-
-- name: check scipion scipion_conf/scipion.conf exist
-  become: yes
-  stat:
-    path: "{{ scipion_conf }}/scipion.conf"
-  register: scipion_conf_file
-
-- name: Create scipion config directory
-  become: yes
-  file:
-    path: "{{ scipion_conf }}"
-    state: directory
-    mode: "0755"
-
-  #when: scipion_conf.stat.exists == True
-- name: Scipion.conf
-  become: yes
-  template:
-    src: "templates/scipion.j2"
-    dest: "{{ scipion_conf }}/scipion.conf"
-    owner: root
-    group: root
-    mode: "0755"
-    backup: yes
-  when: scipion_conf_file.stat.exists == False
-
-- name: hosts.conf
-  become: yes
-  template:
-    src: "templates/hosts.j2"
-    dest: "{{ scipion_conf }}/hosts.conf"
-    owner: root
-    group: root
-    mode: "0755"
-    backup: yes
-
-- name: protocols.conf
-  become: yes
-  template:
-    src: "templates/protocols.j2"
-    dest: "{{ scipion_conf }}/protocols.conf"
-    owner: root
-    group: root
-    mode: "0755"
-    backup: yes
-
-- name: create sciption folder in root directory
-  become: yes
-  file:
-    path: "{{ scipion_conf_root }}"
-    state: directory
-    mode: "0755"
-
-- name: Create config file scipion for root
-  become: yes
-  template:
-    src: "templates/script_scipion_root.j2"
-    dest: "{{ scipion_conf_root }}/scipion.conf"
-    owner: root
-    group: root
-    mode: "0755"
-    backup: yes
-
-- name: Create scipion config all users
-  become: yes
-  file:
-    path: "{{ scipion_conf }}"
-    state: directory
-    mode: "0755"
-
-  #when: scipion_conf.stat.exists == False
-- name: Create config file scipion for all users
-  become: yes
-  template:
-    src: "templates/scipion.j2"
-    dest: "{{ scipion_conf }}/scipion.conf"
-    owner: root
-    group: root
-    mode: "0755"
-    backup: yes
-
-- name: Check scipion Folder
-  become: yes
-  stat:
-    path: "{{ scipion_install_destination }}"
-  register: scipion_dir
-
-- name: Create scipion directory
-  become: yes
-  file:
-    path: "{{ scipion_install_destination }}"
-    state: directory
-    mode: "0755"
+      - make
+      - python3-pip
+      - python3-mpi4py
 
-  # when: scipion_dir.stat.exists == False
-- name: "unzip the binaries of my software {{ scipion_install_version }} into {{ scipion_install_destination }}"
-  unarchive:
-    dest: "{{ scipion_install_destination }}"
-    src: "{{ scipion_repo_base_url }}/{{ scipion_versions[scipion_install_version]['url'] }}"
-    remote_src: yes
-    mode: "0755"
-    extra_opts:
-      - -P
-      - "{{ scipion_versions[scipion_install_version]['password'] }}"
-
-- name: Scipion installation
-  become: yes
-  command: ./scipion install
+- name: install scipion conda requirements
+  shell: source /usr/local/anaconda3/bin/activate && conda install -y -c anaconda mpi4py
   args:
-    chdir: "{{ scipion_install_destination }}/scipion-master"
+    executable: /bin/bash
 
-  #when: scipion_dir.stat.exists == False
-- name: check if scipion installed
-  become: yes
-  stat:
-    path: "{{ installed_path }}"
-  register: installed_scipion_post
-
-- name: symbolic link for scipion
-  become: yes
-  file:
-    src: "{{ installed_path }}"
-    dest: /usr/bin/scipion
-    state: link
-
-- name: Scipion installp
-  become: yes
-  command: scipion installp -p {{ item }}
-  with_items:
-    - scipion-em-bionotes
-    - scipion-em-bsoft
-    - scipion-em-ccp4
-    - scipion-em-continuousflex
-    - scipion-em-cryoef
-    - scipion-em-cryomethods
-    - scipion-em-cryosparc2
-    - scipion-em-eman2
-    - scipion-em-empiar
-    - scipion-em-emxlib
-    - scipion-em-esrf
-    - scipion-em-grigoriefflab
-    - scipion-em-imagic
-    - scipion-em-localrec
-    - scipion-em-motioncorr
-    - scipion-em-phenix
-    - scipion-em-powerfit
-    - scipion-em-xmipp
-    #    - scipion-em-relion Problem GCC version ask for before 6
-    - scipion-em-resmap
-    - scipion-em-simple
-    - scipion-em-sphire
-    - scipion-em-spider
-    - scipion-em-topaz
-  ignore_errors: yes
-
-- name: Scipion xmipp bundle download
-  become: yes
-  git:
-    repo: "{{ dl_urs_git }}"
-    dest: "{{ scipion_xmipp }}/xmipp-bundle"
-    clone: yes
-
-- name: Scipion xmipp installation
-  become: yes
-  command: ./xmipp get_devel_sources
+- name: install scipion installer
+  # do not use offical pip
+  shell: source /usr/local/anaconda3/bin/activate && /usr/local/anaconda3/bin/pip install --user scipion-installer
   args:
-    chdir: "{{ scipion_xmipp }}/xmipp-bundle"
-  ignore_errors: yes
+    executable: /bin/bash
 
-- name: Scipion xmipp dev installation
-  shell: scipion installb xmippDev -j 8
+- name: install scipion
+  shell: source /usr/local/anaconda3/bin/activate && /usr/local/anaconda3/bin/python -m scipioninstaller -conda -noXmipp -noAsk /opt/scipion
+  args:
+    executable: /bin/bash
 
-- name: Create config file scipion for profile.d
-  become: yes
-  template:
-    src: "templates/scipion_profile_d.j2"
-    dest: "{{ scipion_profle_d }}/config_scipion.sh"
-    owner: root
-    group: root
-    mode: a+x
-    backup: yes
+- name: create config for scipion
+  shell: source /usr/local/anaconda3/bin/activate && /opt/scipion/scipion3 config --overwrite --unattended
+  args:
+    executable: /bin/bash
-- 
GitLab


From dee00cf40577d7d243e7c0e2fa0f3be4c56d2b53 Mon Sep 17 00:00:00 2001
From: Fabio Santaniello <fabio.santaniello@epfl.ch>
Date: Thu, 10 Feb 2022 14:19:42 +0100
Subject: [PATCH 2/3] xmipp start - not working

---
 tasks/main.yml | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/tasks/main.yml b/tasks/main.yml
index 464e7bb..1334ab3 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -35,3 +35,21 @@
   shell: source /usr/local/anaconda3/bin/activate && /opt/scipion/scipion3 config --overwrite --unattended
   args:
     executable: /bin/bash
+
+#-name: install xmipp requirements
+# apt:
+#   state: latest
+#   pkg:
+#     - scons
+#     - libfftw3-dev
+#     - libhdf5-dev
+#     - python3-numpy
+#     - python3-dev
+#     - libtiff5-dev
+#     - libsqlite3-dev
+#     - default-jdk
+#     - git
+#     - cmake
+#
+#- name: install xmipp plugin
+#  shell: source /usr/local/anaconda3/bin/activate && /opt/scipion/scipion3 installp -p scipion-em-xmipp -j 12
-- 
GitLab


From f1b6e9aeaebe7253354f4b0b3b2a5a97081fb9a3 Mon Sep 17 00:00:00 2001
From: pullyvan <pullyvan.kris@gmail.com>
Date: Mon, 14 Feb 2022 09:05:05 +0100
Subject: [PATCH 3/3] add xmipp and scipion symbolic link

---
 tasks/main.yml | 42 +++++++++++++++++++++++++-----------------
 1 file changed, 25 insertions(+), 17 deletions(-)

diff --git a/tasks/main.yml b/tasks/main.yml
index 1334ab3..c4a669b 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -36,20 +36,28 @@
   args:
     executable: /bin/bash
 
-#-name: install xmipp requirements
-# apt:
-#   state: latest
-#   pkg:
-#     - scons
-#     - libfftw3-dev
-#     - libhdf5-dev
-#     - python3-numpy
-#     - python3-dev
-#     - libtiff5-dev
-#     - libsqlite3-dev
-#     - default-jdk
-#     - git
-#     - cmake
-#
-#- name: install xmipp plugin
-#  shell: source /usr/local/anaconda3/bin/activate && /opt/scipion/scipion3 installp -p scipion-em-xmipp -j 12
+-name: install xmipp requirements
+ apt:
+   state: latest
+   pkg:
+     - scons
+     - libfftw3-dev
+     - libhdf5-dev
+     - python3-numpy
+     - python3-dev
+     - libtiff5-dev
+     - libsqlite3-dev
+     - default-jdk
+     - git
+     - cmake
+
+- name: Install xmipp plugin
+  shell: /opt/scipion/scipion3 installp -p scipion-em-xmipp -j 12 | tee -a /tmp/xmipp_install.log
+  args:
+    executable: /bin/bash
+
+- name: Create a scipion symbolic link
+  ansible.builtin.file:
+    src: /opt/scipion/scipion3
+    dest: /usr/bin/scipion
+    state: link
-- 
GitLab