This repository has been archived by the owner on Jun 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 549
Https英文文档 #5078
Merged
Merged
Https英文文档 #5078
Changes from 12 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
aac264d
fix example
vvfreesoul b63b0fa
Merge remote-tracking branch 'origin/master'
vvfreesoul 0667251
fix如何设置HTTPS访问eng
vvfreesoul e2195a8
fix如何设置HTTPS访问eng
vvfreesoul 2839cd3
fix如何设置HTTPS访问eng
vvfreesoul c6325eb
Modification
vvfreesoul 1f510c5
Modification
vvfreesoul fc891a7
fix link
vvfreesoul edffb93
fix link
vvfreesoul 73bb225
fix link
vvfreesoul 0e3b4d4
can link
vvfreesoul 2f0e426
can link
vvfreesoul aa4e71c
add a space
vvfreesoul 540c75c
Merge branch 'master' of https://github.com/microsoft/pai into zgw_ht…
vvfreesoul 4f95dfb
fix links for Chinese version doc
vvfreesoul File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,7 @@ There is a shortcut to k8s dashboard on the webportal. However, it needs special | |
|
||
<img src="./imgs/k8s-dashboard.png" width="100%" height="100%" /> | ||
|
||
To use it, you should first set up `https` access (Using `http://<ip>` won't work) for OpenPAI. Then, on the dev box machine, follow the steps below: | ||
To use it, you should first set up `https` access (Using `http://<ip>` won't work) for OpenPAI. Please refer to [here](#how-to-set-up-https). Then, on the dev box machine, follow the steps below: | ||
|
||
**Step 1.** Save following yaml text as `admin-user.yaml` | ||
|
||
|
@@ -151,4 +151,116 @@ Another example is to restart the whole cluster: | |
./paictl.py service start | ||
``` | ||
|
||
You can use `exit` to leave the dev-box container, and use `sudo docker exec -it dev-box bash` to re-enter it if you desire so. If you don't need it any more, use `sudo docker stop dev-box` and `sudo docker rm dev-box` to delete the docker container. | ||
You can use `exit` to leave the dev-box container, and use `sudo docker exec -it dev-box bash` to re-enter it if you desire so. If you don't need it any more, use `sudo docker stop dev-box` and `sudo docker rm dev-box` to delete the docker container. | ||
|
||
## How To Set Up HTTPS | ||
|
||
To configure https certificate for pylon, you need to obtain a digital certificate first, and then save the digital certificate-related files in the dev-box container. In the dev-box container, you can find the configuration file `services-configuration.yaml`, and then you need to add the file path of the saved digital certificate into the `services-configuration.yaml` file. You can choose a self-signed certificate or a certificate issued by a CA. Next, we will first demonstrate the configuration process of a self-signed certificate. The configuration processes for the two types of certificates are similar. | ||
|
||
### Configure A Self-Signed Certificate | ||
|
||
|
||
#### 1. Enter the dev-box container | ||
|
||
You need to use [`paictl`](#pai-service-management-and-paictl) to enter the container in the following way: | ||
|
||
```bash | ||
sudo docker exec -it dev-box bash | ||
``` | ||
|
||
#### 2. Create a folder in the dev-box container | ||
When you enter the container, you need to create a folder and generate a self-signed certificate in this folder. You can create an `ssl` folder in the `home` folder. | ||
|
||
``` bash | ||
mkdir /home/ssl | ||
cd /home/ssl | ||
``` | ||
#### 3. Generate RSA private key with openssl | ||
|
||
``` bash | ||
openssl genrsa -des3 -out FileName.key 1024 | ||
``` | ||
In this step, a password will be asked.The following commands you enter will use the `FileName` parameter multiple times. You can choose a suitable file name to replace `FileName`. | ||
|
||
|
||
#### 4. Generate certificate request | ||
|
||
```bash | ||
SUBJECT="/C=US/ST=Washington/CN=FileName" | ||
openssl req -new -subj $SUBJECT -key FileName.key -out FileName.csr | ||
``` | ||
|
||
#### 5. Generate certificate | ||
|
||
```bash | ||
mv FileName.key FileName.origin.key | ||
openssl rsa -in FileName.origin.key -out FileName.key | ||
openssl x509 -req -days 3650 -in FileName.csr -signkey FileName.key -out FileName.crt | ||
``` | ||
|
||
#### 6. Final result | ||
|
||
In the current directory, you will find 4 files: | ||
|
||
<div align="center"> | ||
<img src="./imgs/openssl_result.png" alt="paictl overview picture" style="float: center; margin-right: 10px;" /> | ||
</div> | ||
|
||
#### 7. Configure services-configuration.yaml | ||
|
||
|
||
If you are configuring PAI service for the first time, `services-configuration.yaml` may not exist in the dev-box container. You should follow the procedure below to change the configuration file and make it effective. Then, stop the pylon service, pull the OpenPAI configuration file `services-configuration.yaml` to the local, change the configuration file, upload the configuration file, and restart the pylon service. The commands you need are: | ||
```bash | ||
./paictl.py service stop -n pylon | ||
./paictl.py config pull -o <config-folder> | ||
vim <config-folder>/services-configuration.yaml | ||
./paictl.py config push -p <config-folder> -m service | ||
./paictl.py service start -n pylon | ||
``` | ||
|
||
|
||
If you already have `services-configuration.yaml` in your container, you can omit the process of pulling the file. Please note that the master_ip in the configuration file is the IP of your master machine, not the IP of your dev box machine. Please configure the yaml file in the following format: | ||
``` | ||
pylon: | ||
port: 80 | ||
uri: "http://master_ip:80" | ||
ssl: | ||
crt_name: xxxxxx | ||
crt_path: /path/to/xxxxxx | ||
key_name: yyyyyy | ||
key_path: /path/to/yyyyyy | ||
``` | ||
With the example we just gave, the configuration file content should be: | ||
``` | ||
pylon: | ||
port: 80 | ||
uri: "http://master_ip:80" | ||
ssl: | ||
crt_name: FileName.crt | ||
crt_path: /home/ssl/FileName.crt | ||
key_name: FileName.key | ||
key_path: /home/ssl/FileName.key | ||
``` | ||
Restart the pylon service, and you will be able to access OpenPAI via https. | ||
|
||
#### Configure CA certificate | ||
##### 1. Save the CA certificate in the dev-box container | ||
To configure a CA certificate, you first need to apply for and export it. You will eventually get a crt file and a key file. Please save these two files in the dev-box container. As shown in the following picture, the two files are saved in `/home/ssl`. | ||
|
||
<div align="center"> | ||
<img src="./imgs/openssl_CA_result.png" alt="paictl overview picture" style="float: center; margin-right: 10px;" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The image links for Chinese version doc should also be updated. Please update them in this pr too. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok |
||
</div> | ||
|
||
##### 2. Configure services-configuration.yaml | ||
In this step, you can configure the `services-configuration.yaml` in accordance with the Step 7 in the process of `Configure a self-signed certificate`. For example: | ||
|
||
``` | ||
pylon: | ||
port: 80 | ||
uri: "http://master_ip:80" | ||
ssl: | ||
crt_name: n32.openpai.org_chain.crt | ||
crt_path: /home/ssl/n32.openpai.org_chain.crt | ||
key_name: n32.openpai.org_key.key | ||
key_path: /home/ssl/n32.openpai.org_key.key | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a space before
The following commands you enter will
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok