Package: activate-aiida
activate-aiidaThis is a small package to build around the internalaiida-coretools (v1.2), to quickly create and launchisolatedAiiDA environments from scratch. Its focussed on development, but can also be used more generally.The basic steps are:Buy a new computerInstall CondaOn linux:wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.shbash miniconda.shconda update condaCreate the development environment:conda env create -n aiida-dev -f aiida-dev-env.ymlconda activate aiida-devThis is a copy ofenvironment.yamlin aiida-core,
but with all the extra development packages, and other goodies like jupyter labInstall aiida-core in development modepip install --no-deps -e .Runsource aiida-activate --helpto see the optionsThis needs to be called withsource, so that it can set-up some environmental variablesRunningsource aiida-activate setup.yaml -c -w 4will:Initialise a database atstore_path/pgsql, if it doesn't already existKill any currently running postgres serverStart up a postgres server with the desired settingsEnsure RabbitMQ is runningSet the aiida repository path tostore_path/.aiidaRunverdi quicksetup --config=setup.yaml, if the profile does not already existSet the profile as the default profileStop any current daemon and start one with 4 workersActivate verdi tab completionWhen your done,aiida-deactivatewill stop the daemon and the postgres serverExample Config Filestore_path:/home/csewell/Documents/aiida-core/test_reposu_db_username:chrisjsewell# su_db_password:  # not yet supporteddb_engine:postgresql_psycopg2db_backend:djangodb_host:localhostdb_port:5432db_name:basic_dbdb_username:chrisjsewelldb_password:nicedayprofile:basicemail:christopher.sewell@epfl.chfirst_name:Chrislast_name:Sewellinstitution:EPFLnon_interactive:trueExample CLI$sourceaiida-activatesetup.yaml-c-w4parsed args: -c true -w 4 setup.yaml- Reading variables from setup.yaml- Setting Up SQL DatabasePGDATA='/home/csewell/Documents/aiida-core/test_repo/pgsql'- Activating Postgres server: /home/csewell/Documents/aiida-core/test_repo/pgsql on port 5432waiting for server to start.... doneserver startedLogging Postgres server to: /home/csewell/Documents/aiida-core/test_repo/pgsql/postgres_env_.log- Ensure RabbitMQ Running- Setting Up AiiDa DatabaseAIIDA_PATH='/home/csewell/Documents/aiida-core/test_repo'Info: Database user "chrisjsewell" already exists!Use it?  [y/N]: ySuccess: created new profile `basic`.Info: migrating the database.Operations to perform:Apply all migrations: auth, contenttypes, dbRunning migrations:Applying contenttypes.0001_initial... OKApplying contenttypes.0002_remove_content_type_name... OKApplying auth.0001_initial... OKApplying auth.0002_alter_permission_name_max_length... OKApplying auth.0003_alter_user_email_max_length... OKApplying auth.0004_alter_user_username_opts... OKApplying auth.0005_alter_user_last_login_null... OKApplying auth.0006_require_contenttypes_0002... OKApplying auth.0007_alter_validators_add_error_messages... OKApplying auth.0008_alter_user_username_max_length... OKApplying auth.0009_alter_user_last_name_max_length... OKApplying auth.0010_alter_group_name_max_length... OKApplying auth.0011_update_proxy_permissions... OKApplying db.0001_initial... OKApplying db.0002_db_state_change... OKApplying db.0003_add_link_type... OKApplying db.0004_add_daemon_and_uuid_indices... OKApplying db.0005_add_cmtime_indices... OKApplying db.0006_delete_dbpath... OKApplying db.0007_update_linktypes... OKApplying db.0008_code_hidden_to_extra... OKApplying db.0009_base_data_plugin_type_string... OKApplying db.0010_process_type... OKApplying db.0011_delete_kombu_tables... OKApplying db.0012_drop_dblock... OKApplying db.0013_django_1_8... OKApplying db.0014_add_node_uuid_unique_constraint... OKApplying db.0015_invalidating_node_hash... OKApplying db.0016_code_sub_class_of_data... OKApplying db.0017_drop_dbcalcstate... OKApplying db.0018_django_1_11... OKApplying db.0019_migrate_builtin_calculations... OKApplying db.0020_provenance_redesign... OKApplying db.0021_dbgroup_name_to_label_type_to_type_string... OKApplying db.0022_dbgroup_type_string_change_content... OKApplying db.0023_calc_job_option_attribute_keys... OKApplying db.0024_dblog_update... OKApplying db.0025_move_data_within_node_module... OKApplying db.0026_trajectory_symbols_to_attribute... OKApplying db.0027_delete_trajectory_symbols_array... OKApplying db.0028_remove_node_prefix... OKApplying db.0029_rename_parameter_data_to_dict... OKApplying db.0030_dbnode_type_to_dbnode_node_type... OKApplying db.0031_remove_dbcomputer_enabled... OKApplying db.0032_remove_legacy_workflows... OKApplying db.0033_replace_text_field_with_json_field... OKApplying db.0034_drop_node_columns_nodeversion_public... OKApplying db.0035_simplify_user_model... OKApplying db.0036_drop_computer_transport_params... OKApplying db.0037_attributes_extras_settings_json... OKApplying db.0038_data_migration_legacy_job_calculations... OKApplying db.0039_reset_hash... OKApplying db.0040_data_migration_legacy_process_attributes... OKApplying db.0041_seal_unsealed_processes... OKApplying db.0042_prepare_schema_reset... OKApplying db.0043_default_link_label... OKApplying db.0044_dbgroup_type_string... OKSuccess: database migration completed.- Starting AiiDARescanning aiida pluginsSetting default profile: basicSuccess: basic set as default profileStopping any current daemonProfile: basicDaemon was not runningActivating daemon for profile: basic with 4 workersActivating verdi tab completion- Finishing Status:✓ config dir:  /home/csewell/Documents/aiida-core/test_repo/.aiida✓ profile:     On profile basic✓ repository:  /home/csewell/Documents/aiida-core/test_repo/.aiida/repository/basic✓ postgres:    Connected as chrisjsewell@localhost:5432✓ rabbitmq:    Connected to amqp://127.0.0.1?heartbeat=600✓ daemon:      Daemon is running as PID 22227 since 2020-04-10 00:55:10$deactivate-aiidaStopping Daemon:Profile: basicWaiting for the daemon to shut down... OKStopping Postgres:waiting for server to shut down.... doneserver stoppedDone!TroubleshootingIf postgres is not stopped correctly you may get this error:psql: could not connect to server: No such file or directoryIn this case you may have to manually delete thepath/to/database/postmaster.pidfile (seehere)If a port has been left open (fromhere):>> sudo lsof -i :PORTNUM
>> sudo kill -9 PID