Skip to content

Commit

Permalink
Settle umask
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Dec 1, 2023
1 parent 12993fd commit bd61ee0
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
43 changes: 43 additions & 0 deletions docs/developers/build-apple-silicon.md
Original file line number Diff line number Diff line change
@@ -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.

<img src="images/utm_ports_mapping.png" width="350px">

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
Binary file added docs/developers/images/utm_ports_mapping.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
8 changes: 8 additions & 0 deletions local/tasks/customise-bash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 23 additions & 0 deletions local/tasks/files/README-qeapp.md.j2
Original file line number Diff line number Diff line change
@@ -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 }}.
2 changes: 1 addition & 1 deletion playbook-aiidalab-qe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit bd61ee0

Please sign in to comment.