From be1396db2e292b73be7742b2a53c64068ddc4c91 Mon Sep 17 00:00:00 2001 From: micafer Date: Wed, 9 Feb 2022 16:15:30 +0100 Subject: [PATCH 1/5] Add pypka template --- templates/pypka.radl | 77 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 templates/pypka.radl diff --git a/templates/pypka.radl b/templates/pypka.radl new file mode 100644 index 0000000..d97837f --- /dev/null +++ b/templates/pypka.radl @@ -0,0 +1,77 @@ +description pypka ( + kind = 'component' and + short = 'PypKa Server.' and + content = 'Flexible Poisson-Boltzmann based pKa calculations with proton tautomerism. + +Webpage: https://pypka.org/' +) + +configure front ( +@begin +--- + - ec3_prio: -10 + tasks: + + - name: Add psql repo key + apt_key: + url: "https://www.postgresql.org/media/keys/ACCC4CF8.asc" + state: present + + - name: Add psql repo + apt_repository: + repo: 'deb http://apt.postgresql.org/pub/repos/apt/ {{ansible_distribution_release}}-pgdg main' + state: present + update_cache: yes + + - name: install apt requisites + apt: + pkg: + - ligfortran4 + - gawk + - python3-pip + - autossh + - postgresql + + - name: Install pypka + pip: + name: + - sqlalchemy + - psycopg2-binary + - pypka +@end +) + +configure wn ( +@begin +--- + - ec3_prio: -10 + tasks: + + - name: Add psql repo key + apt_key: + url: "https://www.postgresql.org/media/keys/ACCC4CF8.asc" + state: present + + - name: Add psql repo + apt_repository: + repo: 'deb http://apt.postgresql.org/pub/repos/apt/ {{ansible_distribution_release}}-pgdg main' + state: present + update_cache: yes + + - name: install apt requisites + apt: + pkg: + - ligfortran4 + - gawk + - python3-pip + - autossh + - postgresql + + - name: Install pypka + pip: + name: + - sqlalchemy + - psycopg2-binary + - pypka +@end +) \ No newline at end of file From 09b72bd4e37fcc0693e8beceeef7520c2635e7f4 Mon Sep 17 00:00:00 2001 From: micafer Date: Wed, 9 Feb 2022 16:19:05 +0100 Subject: [PATCH 2/5] fix typo --- templates/pypka.radl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/pypka.radl b/templates/pypka.radl index d97837f..99f16aa 100644 --- a/templates/pypka.radl +++ b/templates/pypka.radl @@ -26,7 +26,7 @@ configure front ( - name: install apt requisites apt: pkg: - - ligfortran4 + - libgfortran4 - gawk - python3-pip - autossh @@ -61,7 +61,7 @@ configure wn ( - name: install apt requisites apt: pkg: - - ligfortran4 + - libgfortran4 - gawk - python3-pip - autossh From aa11f88c2afd1d43ad6d993e52d8eb9430273a1f Mon Sep 17 00:00:00 2001 From: Miguel Caballer Date: Thu, 10 Feb 2022 09:14:09 +0100 Subject: [PATCH 3/5] add python2 --- templates/pypka.radl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/pypka.radl b/templates/pypka.radl index 99f16aa..c370475 100644 --- a/templates/pypka.radl +++ b/templates/pypka.radl @@ -31,6 +31,7 @@ configure front ( - python3-pip - autossh - postgresql + - python2 - name: Install pypka pip: @@ -66,6 +67,7 @@ configure wn ( - python3-pip - autossh - postgresql + - python2 - name: Install pypka pip: @@ -74,4 +76,4 @@ configure wn ( - psycopg2-binary - pypka @end -) \ No newline at end of file +) From f920aa9ed9ac36b386f027c4896aca916a215588 Mon Sep 17 00:00:00 2001 From: Miguel Caballer Date: Thu, 10 Feb 2022 15:48:13 +0100 Subject: [PATCH 4/5] Update pypka.radl --- templates/pypka.radl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/pypka.radl b/templates/pypka.radl index c370475..8b8eeef 100644 --- a/templates/pypka.radl +++ b/templates/pypka.radl @@ -66,7 +66,7 @@ configure wn ( - gawk - python3-pip - autossh - - postgresql + - postgresql-client - python2 - name: Install pypka From 43050333659d53c9e0eadf21a1c864750de2219c Mon Sep 17 00:00:00 2001 From: Miguel Caballer Date: Mon, 14 Feb 2022 12:25:27 +0100 Subject: [PATCH 5/5] Fix error showing non ascii chars --- ec3 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ec3 b/ec3 index dbf9be8..cf7820e 100755 --- a/ec3 +++ b/ec3 @@ -380,7 +380,7 @@ class Display: @staticmethod def display(msg): Display.clean() - sys.stdout.write(str(msg) + "\n") + sys.stdout.write("%s\n" % msg) sys.stdout.flush() class ClusterStore: @@ -719,7 +719,7 @@ class CmdLaunch: for elem in resp.json()["uri-list"]: vm_ids.append(os.path.basename(list(elem.values())[0])) except Exception as e: - CLI.display("Error launching front-end: %s" % str(e), level=logging.ERROR) + CLI.display("Error launching front-end: %s" % e.message, level=logging.ERROR) sys.exit(1) CLI.display("Infrastructure successfully created with ID: %s" % infrId, alt=infrId)