Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docsify #1

Merged
merged 23 commits into from
Apr 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 39 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,39 @@
## Gravity Documentation
[上海交通大学天文系Gravity集群文档](https://gravity-doc.github.io)

This is the documentation for the **Gravity Cluster** of [Department of Astronomy](http://astro.sjtu.edu.cn/en/) at [Shanghai Jiao Tong University (SJTU)](https://www.sjtu.edu.cn/).

### Welcome to contribute
This doc is hosted on [Github](https://github.com/gravity-doc/gravity-doc.github.io). Feel free to submit a pull request.

Your name will be honoured in the [contributor list](https://github.com/gravity-doc/gravity-doc.github.io/graphs/contributors) once your contributions are merged.

**中文内容也欢迎!🥳**


### Contact

You can contact us via

- [[email protected]](mailto:[email protected])
- **WeChat group**

if you need

1. create an **account** 🙋‍♂️🙋‍♀️
2. change **password** 🔐
3. **extend time** of your job ⌛
4. other problems ❔

### Acknowledging the Gravity Cluster

We would appreciate it if all publications that include results generated using **Gravity** cluster include a short statement in the Acknowledgment section. For example:

若您在论文中使用了Gravity得到的结果,希望您能够在致谢中提到**Gravity**。例如:

- **本工作的计算使用了上海交通大学天文系Gravity高性能计算集群**
- **This work made use of the Gravity Supercomputer at the Department of Astronomy, Shanghai Jiao Tong University.**

<img src="./docs/images/logo_DOA_large.png" height = "80" div align=right />
## Gravity Documentation

[上海交通大学天文系Gravity集群文档](https://gravity-doc.github.io)

This is the documentation for the **Gravity Cluster** of [Department of Astronomy](http://astro.sjtu.edu.cn/en/) at [Shanghai Jiao Tong University (SJTU)](https://www.sjtu.edu.cn/).

### Welcome to contribute

This doc is hosted on [Github](https://github.com/gravity-doc/gravity-doc.github.io). Feel free to submit a pull request.

Your name will be honoured in the [contributor list](https://github.com/gravity-doc/gravity-doc.github.io/graphs/contributors) once your contributions are merged.

**中文内容也欢迎!🥳**


### Contact

You can contact us via

- [[email protected]](mailto:[email protected])
- **WeChat group**

if you need

1. create an **account** 🙋‍♂️🙋‍♀️
2. change **password** 🔐
3. **extend time** of your job ⌛
4. other problems ❔

### Acknowledging the Gravity Cluster

We would appreciate it if all publications that include results generated using **Gravity** cluster include a short statement in the Acknowledgment section. For example:

若您在论文中使用了Gravity得到的结果,希望您能够在致谢中提到**Gravity**。例如:

- **本工作的计算使用了上海交通大学天文系Gravity高性能计算集群**
- **This work made use of the Gravity Supercomputer at the Department of Astronomy, Shanghai Jiao Tong University.**

![logo_DOA_large.png](./docs/images/logo_DOA_large.png)
39 changes: 16 additions & 23 deletions admin/websample.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,30 @@
---
sort: 10086
---

# Samples for web



## 主题和主题使用说明

[Theme](https://rundocs.io)

## examples for 各种框框

```note
### This is a note

Markdown is supported, Text can be **bold**, _italic_, or ~~strikethrough~~. [Links](https://github.com) should be blue with no underlines

`inline code`
> [!NOTE]
> ### This is a note
> Markdown is supported, Text can be **bold**, _italic_, or ~~strikethrough~~. [Links](https://github.com) should be blue with no underlines
> `inline code`
> [`inline code inside link`](#)
>

[`inline code inside link`](#)
```
> [!TIP]
> It's bigger than a bread box.
>

```tip
It's bigger than a bread box.
```
> [!WARNING]
> Strong prose may provoke extreme mental exertion. Reader discretion is strongly advised.
>

```warning
Strong prose may provoke extreme mental exertion. Reader discretion is strongly advised.
```

```danger
Mad scientist at work!
```
> [!ATTENTION]
> Mad scientist at work!
>

## 代码

Expand Down
69 changes: 69 additions & 0 deletions convert_to_docsify.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/bin/bash
################### convert_to_docsify.sh ###################
# This script is used to convert the original markdown files
# to docsify markdown files.
#############################################################
set -e

# Check if the script is running inside a Git repository
if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
echo "This script must be run inside a Git repository!!!"
exit 1
fi

# switch to docsify branch
git checkout docsify
# undo any changes
git checkout .
# pull latest changes
git pull

source_file="docs/index.md"
target_file="docs/README.md"

# Check if source file exists
if [ ! -f "$source_file" ]; then
echo "source file $source_file does not exist"
else
# Rename file
mv "$source_file" "$target_file"
fi

# Function to process markdown files
process_markdown() {
echo "Processing $1"
# Remove part of "--- ... ---"
sed -i '/^---[[:space:]]*$/,/^---[[:space:]]*$/d' "$1"

# Convert HTML image to markdown image
sed -i 's|<img src="\(.*\)/\([^"/]*\)"[^>]*>|![\2](\1/\2)|g' "$1"

# Convert danger, warning, note, and tip blocks
sed -i -E -e '/^```(danger|warning|note|tip)[[:space:]]*$/,/^```[[:space:]]*$/ {
/^```(danger|warning|note|tip)[[:space:]]*$/! {
s/^[>-][[:space:]]*//
s/^[[:digit:]]+\.*//
/^[[:space:]]*$/d
}
s/^```(danger|warning)[[:space:]]*$/!> \*\*Important\*\*⚠️/
s/^```(note|tip)[[:space:]]*$/?> \*\*Tip\*\*💡/
s/```[[:space:]]*$//
t
}' "$1"
}

export -f process_markdown

# Process markdown files using find and process_markdown function
find . -type f -name "*.md" -exec bash -c 'process_markdown "$0"' {} \;

# Build Docker image of docsify
if [ -d "docs" ] && [ "$(id -u)" = "0" ]; then
cd docs
docker build -f Dockerfile -t docsify/demo .
docker restart docsify
else
echo "docs directory does not exist or you are not root"
fi

echo "Done"
6 changes: 1 addition & 5 deletions docs/About.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
---
sort: 2
title: System Specs
---
# Hardware
<img src="./images/hardware.jpg" width = "300" height = "500" div align=center />
![hardware.jpg](./images/hardware.jpg)

### Login nodes

Expand Down
16 changes: 6 additions & 10 deletions docs/Advanced/Gitlab.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
---
sort: 6
title: Gitlab
---

```note
There is a *self-hosted* **Gitlab** instance at **Gravity**: [https://git.gravity.sjtu.edu.cn](https://git.gravity.sjtu.edu.cn)
```
> [!NOTE]
> There is a *self-hosted* **Gitlab** instance at **Gravity**: [https://git.gravity.sjtu.edu.cn](https://git.gravity.sjtu.edu.cn)
>

## Login

[Open Gitlab on browser](https://git.gravity.sjtu.edu.cn/), there are **two ways** to login:

1. Your *Gravity* username and password
<img src="../images/Advanced/gitlab-passwd-login.png" height = "200" div align=center />
![gitlab-passwd-login.png](../images/Advanced/gitlab-passwd-login.png)
2. Use *Authelia* authorization at bottom of login page
<img src="../images/Advanced/gitlab-authelia-login.png" height = "200" div align=center />
<img src="../images/Advanced/gitlab-authelia-confirm.png" height = "200" div align=center />
![gitlab-authelia-login.png](../images/Advanced/gitlab-authelia-login.png)
![gitlab-authelia-confirm.png](../images/Advanced/gitlab-authelia-confirm.png)


## SSH Access
Expand Down
12 changes: 4 additions & 8 deletions docs/Advanced/Globus.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sort: 5
title: Globus
---

# Globus
[Globus](https://www.globus.org) is quite popular to transfer large scientific data.
Expand All @@ -27,15 +23,15 @@ Here we provide the routine to install Globus personal version. You can also ch
./globusconnectpersonal -setup
```

<img src="../images/Advanced/globus-setup1.png" width = "600" div align=center />
![globus-setup1.png](../images/Advanced/globus-setup1.png)

A long link will be provided. Copy and open the above link in your browser. After sign in your globus account, an authorization code will be provided.

<img src="../images/Advanced/globus-setup2.png" width = "600" div align=center />
![globus-setup2.png](../images/Advanced/globus-setup2.png)

Input this code in your terminal, type the name for this Endpoint (Gravity2 in the above case) and finish the setup.

<img src="../images/Advanced/globus-setup3.png" width = "600" div align=center />
![globus-setup3.png](../images/Advanced/globus-setup3.png)

5. Run Globus personal without GUI.
```bash
Expand All @@ -44,7 +40,7 @@ Here we provide the routine to install Globus personal version. You can also ch

Check whether the Endpoint is correctly appeared in your Globus Endpoint Collections.

<img src="../images/Advanced/globus-setup4.png" width = "600" div align=center />
![globus-setup4.png](../images/Advanced/globus-setup4.png)

6. Stop Globus personal.
Please close your Globus personal when your transfer task is end, for safety and resources saving reason.
Expand Down
3 changes: 0 additions & 3 deletions docs/Advanced/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
---
sort: 2
---

# Advanced

Expand Down
41 changes: 18 additions & 23 deletions docs/Advanced/VNC.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
---
sort: 2
title: VNC
---

```note
Considering security, *Gravity* closes ports except **22, 80, 443**.
Therefore, you need **ssh tunnel** to connect other service.
```

```tip
VNC is a fast tool to connect to a graphical desktop on the server.
You should add **5900** to your port. That is the **real** port. For example:
`vncserver :66`
Then, the real port VNC uses is **`66 + 5900 = 5966`**
When you use *SSH tunnel*, please connect to the real port, otherwise you will fail🤣
```
> [!NOTE]
> Considering security, *Gravity* closes ports except **22, 80, 443**.
> Therefore, you need **ssh tunnel** to connect other service.
>

> [!TIP]
> VNC is a fast tool to connect to a graphical desktop on the server.
> You should add **5900** to your port. That is the **real** port. For example:
> `vncserver :66`
> Then, the real port VNC uses is **`66 + 5900 = 5966`**
> When you use *SSH tunnel*, please connect to the real port, otherwise you will fail🤣
>

## Getting started

Expand All @@ -35,11 +31,10 @@ Take a note of the port number (37 in this case). You will need to connect to th

请记住这里显示的端口号(图中是37)。

```tip
You will be prompted to setup a password the first time you do this. This will be the password you use to connect to vnc. This password is separate from the ssh password.

第一次开启vnc时在输入命令后会先让你设置密码,之后再使用或者开启新的端口都会使用默认密码.
```
> [!TIP]
> You will be prompted to setup a password the first time you do this. This will be the password you use to connect to vnc. This password is separate from the ssh password.
> 第一次开启vnc时在输入命令后会先让你设置密码,之后再使用或者开启新的端口都会使用默认密码.
>

- checking for running servers

Expand Down Expand Up @@ -77,11 +72,11 @@ You will need to use a vnc client to connect to your server. On Linux, you can u

In Remmina, select "new connection". In protocol, select VNC. In the Basic tab, fill in the server address and vncserver port, your username and vnc password.

<img src="../images/Advanced/VNC_1.png" width=400/>
![VNC_1.png](../images/Advanced/VNC_1.png)

For security reasons, you can only connect to vnc through ssh-tunnel. This can be done in the "SSH Tunnel" tab. Select "Enable SSH tunnel", input your username, and select Public key authentication.

<img src="../images/Advanced/VNC_2.png" width=400/>
![VNC_2.png](../images/Advanced/VNC_2.png)

你可以使用喜欢的vnc客户端连到前面建立的vncserver。在客户端中输入服务器地址和vncserver端口号。由于安全原因,还需要选择打开ssh-tunnel选项。

Expand Down
Loading