Git Product home page Git Product logo

spiritumduo's Introduction

Spiritum Duo

A docker based web app for improving clinical pathways

Overview

Ongoing work, but this repo will hold all of the work for the modular and open-source digital pathway. Initial work will be on the lung cancer pathway, but this work would implemented so that other disease sites and trusts can benefit from this work or actively on this project, and plan to expand the README file to make it easier to understand this program.

Installation

For full installation instructions, please see INSTALL.md.

Glossary

Please see GLOSSARY.md

spiritumduo's People

Contributors

cotswoldsmaker avatar jcf54 avatar nickives avatar niftyr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

pauldscarroll

spiritumduo's Issues

Install.dev.py updates

@jcf54

  • It would be nice to have a "Would you like to install with all defaults" option at the start of the install script so not to have to press enter lots of times. If you say, "No", then you can press enter where you want defaults, but then enter different variables (much as you have now) if needed.
  • Could we have it so there is an option during install to either install or not install Word press? Default should be to not install.
  • Could we have a "Installed in xxx mins:sec" final output so we can compair times?

`install.md` Review

Installation (dev environment)

Overall

  • FAILED to get a working instance using the instructions. Could not get the database to migrate (see below).
  • Pick issue up at next sprint meeting ...

Installation Pre-requisites

  • Clear instructions
  • Tested on an Ubuntu 20.04 VM with only and editor, git, docker & docker-compose installed

Configuring Environment Variables

  • A bit tedious duplicating but the instructions were clear
  • Missing an instruction to create the nginx .env file ... Eg. 6. nginx/.env.example at the top of the section. The description is covered later.

Building node modules

  • I had an initial failure and then realised I was on a vpn and I had an issue resolving https://registry.yarnpkg.com/. It manifested with this error:
Step 4/5 : RUN yarn install --development --silent
 ---> Running in e87d9f47b409
warning Pattern ["@apollo/client@latest"] is trying to unpack in the same destination "/usr/local/share/.cache/yarn/v6/npm-@apollo-client-3.5.5-ce331403ee5f099e595430890f9b510c8435c932-integrity/node_modules/@apollo/client" as pattern ["@apollo/client@>=2.0.0"]. This could result in non-deterministic behavior, skipping.
error An unexpected error occurred: "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.1.0.tgz: getaddrinfo ENOTFOUND registry.yarnpkg.com".
The command '/bin/sh -c yarn install --development --silent' returned a non-zero code: 1
Unable to find image 'sd-frontend:latest' locally
docker: Error response from daemon: pull access denied for sd-frontend, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.
  • Once off vpn it ran fine BUT a log of warnings, which might be concerning. [If you could fix the errors good, but I suspect resolving the dependencies is nigh on impossible ...

Configure docker-compose.dev.yml

  • A bit confusing in that I missed the instruction to create a docker-compose.dev.yml file from the docker-compose-dev.yml.example file. See below. (Or I was confused. Could be both. I note it because I experienced it ...)

Build all containers

  • The instruction to move to the root directory might be clear most, but there are some where it might not be. Could be worth earlier in the document defining terms such as what is meant by "root directory" etc.
  • Running docker-compose -f docker-compose.dev.yml up -d --build created an error. To address need to say at the beginning to copy and rename docker-compose.dev.yml.example to docker-compose.dev.yml. E.g.
  1. Move to the project's root directory
  2. Create a dev docker-compose file by running: cp docker-compose.dev.yml.example docker-compose.dev.yml
  3. Run `docker-compose -f docker-compose.dev.yml up -d --build
  • NB Reviewing the instructions again I see that this step was covered in Configure docker-compose.dev.yml section. So, for whatever reason I missed it which could mean a bunch of things -- like it was late and I am tired and/or the documentation could be clearer.

  • Had an initial failure because there had been no instruction to create a .env file in the nginx section.

Import database schemas

  • Big chunks of text are better in a separate code-block because it is all-to-easy to miss copy. I did, although I was copying from the source rather than from the rendered. Easier of course from rendered. Still thing the point applies though.
  • Copying from rendered still go an error about the "database "spiritum_duo" [which I called it in the .env file] does not exist". Looking at it again, it confirms the point I made that the instructions would be better in code blocks. I missed the and in the two instructions. E.g.
docker exec -ti sd-backend bash -c "chmod +x ./bin/container-migrate-alembic && ./bin/container-migrate-alembic"

and

docker exec -ti sd-pseudotie bash -c "chmod +x ./bin/container-migrate-alembic && ./bin/container-migrate-alembic"
  • Still get an error that database does not exist. I note that there is an instruction that the containers need to be running before the database can be migrated, without instructions as to get them running. I believe that this would be a good idea, or some instruction as to check that they are.

  • Furthermore, the containers are running so not sure what is going on, and there is a reboot-loop for the sd-nginx-dev container, so there is an issue there. i.e. it keeps restarting.

  • Error reproduced below:

docker exec -ti sd-backend bash -c "chmod +x ./bin/container-migrate-alembic && ./bin/container-migrate-alembic"
/usr/local/lib/python3.9/site-packages/sqlalchemy/sql/base.py:299: SAWarning: Can't validate argument 'native_enum'; can't locate any SQLAlchemy dialect named 'native'
  util.warn(
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 2336, in _wrap_pool_connect
    return fn()
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 304, in unique_connection
    return _ConnectionFairy._checkout(self)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 778, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 495, in checkout
    rec = pool._do_get()
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/impl.py", line 241, in _do_get
    return self._create_connection()
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 309, in _create_connection
    return _ConnectionRecord(self)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 440, in __init__
    self.__connect(first_connect_check=True)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 661, in __connect
    pool.logger.debug("Error on connect(): %s", e)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__
    compat.raise_(
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
    raise exception
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 656, in __connect
    connection = pool._invoke_creator(self)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
    return dialect.connect(*cargs, **cparams)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/default.py", line 508, in connect
    return self.dbapi.connect(*cargs, **cparams)
  File "/usr/local/lib/python3.9/site-packages/psycopg2/__init__.py", line 122, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: FATAL:  database "spiritum_duo" does not exist


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/bin/alembic", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/alembic/config.py", line 588, in main
    CommandLine(prog=prog).main(argv=argv)
  File "/usr/local/lib/python3.9/site-packages/alembic/config.py", line 582, in main
    self.run_cmd(cfg, options)
  File "/usr/local/lib/python3.9/site-packages/alembic/config.py", line 559, in run_cmd
    fn(
  File "/usr/local/lib/python3.9/site-packages/alembic/command.py", line 227, in revision
    script_directory.run_env()
  File "/usr/local/lib/python3.9/site-packages/alembic/script/base.py", line 563, in run_env
    util.load_python_file(self.dir, "env.py")
  File "/usr/local/lib/python3.9/site-packages/alembic/util/pyfiles.py", line 92, in load_python_file
    module = load_module_py(module_id, path)
  File "/usr/local/lib/python3.9/site-packages/alembic/util/pyfiles.py", line 108, in load_module_py
    spec.loader.exec_module(module)  # type: ignore
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "alembic/env.py", line 89, in <module>
    run_migrations_online()
  File "alembic/env.py", line 77, in run_migrations_online
    with connectable.connect() as connection:
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 2263, in connect
    return self._connection_cls(self, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 104, in __init__
    else engine.raw_connection()
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 2369, in raw_connection
    return self._wrap_pool_connect(
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 2339, in _wrap_pool_connect
    Connection._handle_dbapi_exception_noconnection(
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1583, in _handle_dbapi_exception_noconnection
    util.raise_(
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
    raise exception
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 2336, in _wrap_pool_connect
    return fn()
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 304, in unique_connection
    return _ConnectionFairy._checkout(self)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 778, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 495, in checkout
    rec = pool._do_get()
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/impl.py", line 241, in _do_get
    return self._create_connection()
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 309, in _create_connection
    return _ConnectionRecord(self)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 440, in __init__
    self.__connect(first_connect_check=True)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 661, in __connect
    pool.logger.debug("Error on connect(): %s", e)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__
    compat.raise_(
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
    raise exception
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 656, in __connect
    connection = pool._invoke_creator(self)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
    return dialect.connect(*cargs, **cparams)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/default.py", line 508, in connect
    return self.dbapi.connect(*cargs, **cparams)
  File "/usr/local/lib/python3.9/site-packages/psycopg2/__init__.py", line 122, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) FATAL:  database "spiritum_duo" does not exist

(Background on this error at: http://sqlalche.me/e/13/e3q8)
/usr/local/lib/python3.9/site-packages/sqlalchemy/sql/base.py:299: SAWarning: Can't validate argument 'native_enum'; can't locate any SQLAlchemy dialect named 'native'
  util.warn(
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 2336, in _wrap_pool_connect
    return fn()
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 304, in unique_connection
    return _ConnectionFairy._checkout(self)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 778, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 495, in checkout
    rec = pool._do_get()
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/impl.py", line 241, in _do_get
    return self._create_connection()
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 309, in _create_connection
    return _ConnectionRecord(self)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 440, in __init__
    self.__connect(first_connect_check=True)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 661, in __connect
    pool.logger.debug("Error on connect(): %s", e)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__
    compat.raise_(
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
    raise exception
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 656, in __connect
    connection = pool._invoke_creator(self)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
    return dialect.connect(*cargs, **cparams)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/default.py", line 508, in connect
    return self.dbapi.connect(*cargs, **cparams)
  File "/usr/local/lib/python3.9/site-packages/psycopg2/__init__.py", line 122, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: FATAL:  database "spiritum_duo" does not exist


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/bin/alembic", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/alembic/config.py", line 588, in main
    CommandLine(prog=prog).main(argv=argv)
  File "/usr/local/lib/python3.9/site-packages/alembic/config.py", line 582, in main
    self.run_cmd(cfg, options)
  File "/usr/local/lib/python3.9/site-packages/alembic/config.py", line 559, in run_cmd
    fn(
  File "/usr/local/lib/python3.9/site-packages/alembic/command.py", line 320, in upgrade
    script.run_env()
  File "/usr/local/lib/python3.9/site-packages/alembic/script/base.py", line 563, in run_env
    util.load_python_file(self.dir, "env.py")
  File "/usr/local/lib/python3.9/site-packages/alembic/util/pyfiles.py", line 92, in load_python_file
    module = load_module_py(module_id, path)
  File "/usr/local/lib/python3.9/site-packages/alembic/util/pyfiles.py", line 108, in load_module_py
    spec.loader.exec_module(module)  # type: ignore
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "alembic/env.py", line 89, in <module>
    run_migrations_online()
  File "alembic/env.py", line 77, in run_migrations_online
    with connectable.connect() as connection:
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 2263, in connect
    return self._connection_cls(self, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 104, in __init__
    else engine.raw_connection()
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 2369, in raw_connection
    return self._wrap_pool_connect(
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 2339, in _wrap_pool_connect
    Connection._handle_dbapi_exception_noconnection(
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1583, in _handle_dbapi_exception_noconnection
    util.raise_(
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
    raise exception
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 2336, in _wrap_pool_connect
    return fn()
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 304, in unique_connection
    return _ConnectionFairy._checkout(self)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 778, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 495, in checkout
    rec = pool._do_get()
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/impl.py", line 241, in _do_get
    return self._create_connection()
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 309, in _create_connection
    return _ConnectionRecord(self)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 440, in __init__
    self.__connect(first_connect_check=True)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 661, in __connect
    pool.logger.debug("Error on connect(): %s", e)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__
    compat.raise_(
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
    raise exception
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 656, in __connect
    connection = pool._invoke_creator(self)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
    return dialect.connect(*cargs, **cparams)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/default.py", line 508, in connect
    return self.dbapi.connect(*cargs, **cparams)
  File "/usr/local/lib/python3.9/site-packages/psycopg2/__init__.py", line 122, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) FATAL:  database "spiritum_duo" does not exist

(Background on this error at: http://sqlalche.me/e/13/e3q8)

General Comments

install.md

  • The formatting of install.md does not pass markdownlint on VSCode. LOTS of errors.

Feedback on the `python INSTALL.py` script

Attempt 1

How I ran the script Attempt 1

  • I ran the script on a machine with just the dependencies and some containers running ....
  • I just hit return to use the defaults to see what happened ...

Comments Attempt 1

  1. While it might be obvious to almost all, instructions on how to use the install script should be in instructions.
  2. The script says for many instructions that a random string will be generated. Where can you get the results? Having random strings being generated is good, but you need to know where they are ... (I found them, but instructions to say you can get them from the .env file would be good
  3. Where there is no default (for the email address) I would add say: (no default, please enter a valid email address)

Result Attempt 1

  • Overall a FAIL and the script said that the installation was successful!
  • None of the docker containers built.
  • There was an exception in migrating the database schema step #8
  • Useful error? "The command 'bin/sh c yarn install --development --silent' returned a non-zero code 1 ERROR: Service 'sd-frontend' failed to build : build failed"
  • I suspect it is because there were conflicts with other containers ... Trying again after deleting all running containers and images on the machine ...
  • It is a BAD thing for a script to say there was a successful installation when evidentially it hadn't. Some post checking?

Attempt 2

  • I ran the script on a machine with just the dependencies ...
  • I just hit return to use the defaults to see what happened ...

Comments Attempt 2

  1. In the prod build of the script I would parse the email entry and ensure only a valid email address was supplied

Result Attempt 2

  • The over-writing of an existing .env file does not work AND saying "no" does not work either! (at base)
  • The over-writing of the other .env files in the other locations doesn't work either, but you can successfully say "No" this time.
  • Overall a FAIL and the script said that the installation was successful!
  • None of the docker containers built.
  • Similar errors as before.
  • I wonder if some of the issues are due to being on my Trust VPN ...

Attempt 3

How I ran the script Attempt 3

  • I ran the script on a machine with just the dependencies and some containers running ....
  • I just hit return to use the defaults to see what happened ...

Comments Attempt 3

  • On step #6: Get a warning 4/5 run install that there is non-deterministic behaviour so skipping with respect to npm@apollo-client-*
  • Then lots of warnings which I did not get before which is suggestive ...
  • It is clear that in some environments the yarn port is blocked which prevents a successful build ...

Result Attempt 3

  • This time a successful build of all the containers BUT Steps had errors/tracebacks: 8 (concerning sd-postgres password authentication failing), 10 (a consequence of 8?)
  • Still says the installation was successful.
  • So better but still a FAIL ...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.