diff --git a/docs/conf.py b/docs/conf.py index 15e6bdf..2fadd2d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -13,7 +13,7 @@ project = "Quantum Mobile" copyright = "2020, NCCR MARVEL" -author = "Chris Sewell, Giovanni Pizzi, Leopold Talirz" +author = "Jusong Yu, Chris Sewell, Giovanni Pizzi, Leopold Talirz" version = inventory["all"]["vars"]["vm_version"] release = version diff --git a/docs/developers/build-apple-silicon.md b/docs/developers/build-apple-silicon.md new file mode 100644 index 0000000..08d990b --- /dev/null +++ b/docs/developers/build-apple-silicon.md @@ -0,0 +1,43 @@ +# Build for Apple Silicon + +Apple Silicon is the new CPU architecture for Apple Macs. +The new architecture is based on ARM64, which means that software compiled for x86_64 will not run on Apple Silicon without translation. +The VirtualBox software is not yet available for Apple Silicon, so we need to use a different virtualization software which is the [UTM](https://mac.getutm.app/). + +## Install and start the VM +- Download latest version of UTM +- browse gallery to have a image setup, we select ubuntu 20.04 LTS https://docs.getutm.app/guides/ubuntu/ +- The arm64 ISO image can be dowloaded from https://cdimage.ubuntu.com/releases/focal/release/ +- During import and setup from ISO, select settings with all default (64GB disk space, 4096MB RAM, default cores ...) +- Create system user `max` with password `moritz` and enable auto login. This will be used for ansible deployment. +- Create a new network setting with type "Emulated VLAN" and forward port 22 to 2200 of localhost so you can ssh to VM from localhost. + + + +You can config ssh with: +``` +Host qmobile + HostName 127.0.0.1 + User max + Port 2200 +``` +- The default `max` user is granted with the sudo permission and the password is `moritz`. + +- To reboot, remember to unmount the image and boot again. + +## Configure the VM + +In the localhost (control machine) + +Run with ansible playbook +``` +BUILD_PLAYBOOK=playbook-aiidalab-qe.yml tox -e ansible -- --extra-vars "build_hosts=utm" -kK +``` + +It will ask for the password of `max` user, which is `moritz`. + +## troubleshotings + +### import from utm copy + +- If you see "Failed to access data from shortcut", try the methods from https://github.com/utmapp/UTM/discussions/3774 \ No newline at end of file diff --git a/docs/developers/images/utm_ports_mapping.png b/docs/developers/images/utm_ports_mapping.png new file mode 100644 index 0000000..700422d Binary files /dev/null and b/docs/developers/images/utm_ports_mapping.png differ diff --git a/docs/index.md b/docs/index.md index 9a3d3be..fca1347 100644 --- a/docs/index.md +++ b/docs/index.md @@ -170,6 +170,7 @@ users/troubleshoot.md developers/customize.md developers/build-vagrant.md developers/build-cloud.md +developers/build-apple-silicon.md developers/roles.md ``` diff --git a/local/tasks/aiidalab.yml b/local/tasks/aiidalab.yml index 3153697..10c1ae4 100644 --- a/local/tasks/aiidalab.yml +++ b/local/tasks/aiidalab.yml @@ -24,7 +24,7 @@ become: true become_user: "{{ vm_user }}" command: "docker run -d --name qeapp -p 8899:8888 --volume /home/{{ vm_user }}/qeapp-home:/home/jovyan -e JUPYTER_TOKEN='max' -e NB_UMASK=002 --restart always {{ vm_qeapp_image }}" - when: qe_container_stat.stdout == "" + when: qe_container_stat.stdout == "" - name: Copy AiiDAlab logo become: true @@ -45,4 +45,3 @@ Terminal=false Icon=/usr/share/icons/aiidalab-qe-logo.png Type=Application - diff --git a/local/tasks/customise-bash.yml b/local/tasks/customise-bash.yml index 6b0dd55..7bb3fdc 100644 --- a/local/tasks/customise-bash.yml +++ b/local/tasks/customise-bash.yml @@ -33,6 +33,14 @@ - regexp: HISTFILESIZE= line: HISTFILESIZE=100000 +- name: Set umask to 002 + blockinfile: + path: "${HOME}/.bashrc" + marker: "# {mark} ANSIBLE MANAGED BLOCK (umask)" + block: | + # Set umask to 002 + umask 002 + - name: hide possible sudo message file: path: ~/.sudo_as_admin_successful diff --git a/local/tasks/docker.yml b/local/tasks/docker.yml index 2d0f9c8..9a868eb 100644 --- a/local/tasks/docker.yml +++ b/local/tasks/docker.yml @@ -18,7 +18,7 @@ name: geerlingguy.docker vars: docker_users: - - "{{ vm_user }}" + - "{{ vm_user }}" when: ansible_architecture == 'x86_64' - name: Install docker (arm64) @@ -26,7 +26,7 @@ name: geerlingguy.docker_arm vars: docker_users: - - "{{ vm_user }}" + - "{{ vm_user }}" when: ansible_architecture == 'aarch64' - name: Install docker pip @@ -34,4 +34,4 @@ name: geerlingguy.pip vars: pip_install_packages: - - docker \ No newline at end of file + - docker diff --git a/local/tasks/files/README-qeapp.md.j2 b/local/tasks/files/README-qeapp.md.j2 new file mode 100644 index 0000000..bf840bb --- /dev/null +++ b/local/tasks/files/README-qeapp.md.j2 @@ -0,0 +1,23 @@ +# Welcome to {{ vm_name }} version {{ vm_version }} + +*Quantum Mobile* is a Virtual Machine for computational materials science, distributed by the {{ vm_author }}. + +It comes with a collection of software packages for quantum mechanical calculations, including: + +{% for name, url in software_urls.items() %} +* [{{ name }}]({{ url }}) +{% endfor %} + +all of which are set up and ready to be used on their own or through [AiiDA](http://www.aiida.net). + +# Getting started + +* Start the Quantum ESPRESSO app by double-clicking on the icon on the desktop. + +* If the virtual machine is just started, you may need to wait a few minutes for the server to be fully ready. If you see an error message, try again after a few minutes. + +* The data you create over the app can be accessed from the `~/qeapp-home` folder. Vise versa, you can copy files into this folder to make them available in the app. + +* For more information on how to use the app, see the [Quantum ESPRESSO app documentation](https://aiidalab-quantumespresso.readthedocs.io/en/latest/). + +For troubleshooting and other information, see: {{ qm_homepage }}. diff --git a/playbook-aiidalab-qe.yml b/playbook-aiidalab-qe.yml index 28f5447..08d33c7 100644 --- a/playbook-aiidalab-qe.yml +++ b/playbook-aiidalab-qe.yml @@ -87,7 +87,7 @@ become: true become_user: "{{ vm_user }}" template: - src: local/tasks/files/README.md.j2 + src: local/tasks/files/README-qeapp.md.j2 dest: "{{ readme_vm_path }}" vars: software_urls: @@ -98,7 +98,6 @@ # Build Specific Tasks # These tasks can be customised for specific VM builds, # depending on the software one requires to be installed - - name: Install docker and docker-compose tags: [docker] import_tasks: local/tasks/docker.yml