Skip to content

Commit 3fa168f

Browse files
authored
Merge pull request #161 from Peefy/add-more-installation-notes
feat: add more install trouble shooting messages on windows platforms
2 parents e7b33e0 + 4a370b5 commit 3fa168f

File tree

12 files changed

+252
-6
lines changed

12 files changed

+252
-6
lines changed

docs/user_docs/getting-started/install.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ GitCommit: {git commit}
127127

128128
For all the above operating systems and installation methods, if you want to use [KCL Python Plugin](/docs/reference/plugin/overview), you need to ensure that Python 3.7+ is installed and add the python3 command to your PATH environment variable.
129129

130+
If you are unable to successfully install and run KCL, you can refer to [here](/docs/user_docs/support/faq-install)
131+
130132
## 2. Install KCL IDE Extension
131133

132134
### VS Code

docs/user_docs/support/faq-install.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,8 @@ Please ensure that the following dependencies are in your PATH:
2626

2727
+ `clang` for MacOS
2828
+ `gcc` for Linux
29-
+ `cl.exe` for Windows, which can be obtained by installing MSVC
29+
+ `cl.exe` for Windows, which can be obtained by installing `MSVC`
30+
31+
## Encountering exit status 0xc0000135 error on Windows platform
32+
33+
Please ensure that .NET Framework and MSVC are installed on your Windows. If not installed, you can install them and try again.

i18n/zh-CN/docusaurus-plugin-content-docs/current/user_docs/getting-started/install.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ GitCommit: {git commit}
127127

128128
对于上述所有安装方式, 如果您想使用 [KCL Python 插件](/docs/reference/plugin/overview), 需要确保您已经安装了 Python 3.7+ 并将 python3 命令添加到您的 PATH 中。
129129

130+
如果您无法成功安装并运行 KCL,可以参考[这里](/docs/user_docs/support/faq-install)
131+
130132
## 2. 安装 KCL IDE 插件
131133

132134
### VS Code

i18n/zh-CN/docusaurus-plugin-content-docs/current/user_docs/support/faq-install.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,14 @@ xattr -rd com.apple.quarantine /path/to/kcl
2020

2121
其中,/path/to/kcl 是 kcl 应用程序的完整路径。运行命令后,应用程序将被添加到白名单中,Gatekeeper 将不再阻止其运行。
2222

23-
## 在 Windows/Linux/MacOS 平台上抱 program not found 或者 run linker failed 错误
23+
## 在 Windows/Linux/MacOS 平台上报 program not found 或者 run linker failed 错误
2424

2525
请确保如下依赖在您的 PATH 中
2626

2727
+ MacOS: `clang`
2828
+ Linux: `gcc`
29-
+ Windows: `cl.exe` (可以通过安装 MSVC 获得)
29+
+ Windows: `cl.exe` (可以通过安装 `MSVC` 获得)
30+
31+
## 在 Windows 平台上遇到 exit status 0xc0000135 错误
32+
33+
请确保您的 Windows 上安装了 .NET Framework 和 MSVC,如没有安装,可以安装并重试

i18n/zh-CN/docusaurus-plugin-content-docs/version-0.6.0/user_docs/getting-started/install.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ GitCommit: {git commit}
127127

128128
对于上述所有安装方式, 如果您想使用 [KCL Python 插件](/docs/reference/plugin/overview), 需要确保您已经安装了 Python 3.7+ 并将 python3 命令添加到您的 PATH 中。
129129

130+
如果您无法成功安装并运行 KCL,可以参考[这里](/docs/user_docs/support/faq-install)
131+
130132
## 2. 安装 KCL IDE 插件
131133

132134
### VS Code

i18n/zh-CN/docusaurus-plugin-content-docs/version-0.6.0/user_docs/support/faq-install.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,14 @@ xattr -rd com.apple.quarantine /path/to/kcl
2020

2121
其中,/path/to/kcl 是 kcl 应用程序的完整路径。运行命令后,应用程序将被添加到白名单中,Gatekeeper 将不再阻止其运行。
2222

23-
## 在 Windows/Linux/MacOS 平台上抱 program not found 或者 run linker failed 错误
23+
## 在 Windows/Linux/MacOS 平台上报 program not found 或者 run linker failed 错误
2424

2525
请确保如下依赖在您的 PATH 中
2626

2727
+ MacOS: `clang`
2828
+ Linux: `gcc`
29-
+ Windows: `cl.exe` (可以通过安装 MSVC 获得)
29+
+ Windows: `cl.exe` (可以通过安装 `MSVC` 获得)
30+
31+
## 在 Windows 平台上遇到 exit status 0xc0000135 错误
32+
33+
请确保您的 Windows 上安装了 .NET Framework 和 MSVC,如没有安装,可以安装并重试

versioned_docs/version-0.6.0/user_docs/getting-started/install.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ GitCommit: {git commit}
127127

128128
For all the above operating systems and installation methods, if you want to use [KCL Python Plugin](/docs/reference/plugin/overview), you need to ensure that Python 3.7+ is installed and add the python3 command to your PATH environment variable.
129129

130+
If you are unable to successfully install and run KCL, you can refer to [here](/docs/user_docs/support/faq-install)
131+
130132
## 2. Install KCL IDE Extension
131133

132134
### VS Code
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Share Your Package to ghcr.io
2+
3+
[kpm](https://github.com/kcl-lang/kpm) is a tool for managing kcl packages. This article will guide you on how to use kpm to push your kcl package to an OCI Registry for publication. kpm uses [ghcr.io](https://ghcr.io) as the default OCI Registry, and you can change the default OCI Registry by modifying the kpm configuration file. For information on how to modify the kpm configuration file, see [kpm oci registry](https://github.com/kcl-lang/kpm/blob/main/docs/kpm_oci.md#kpm-registry)
4+
5+
Here is a simple step-by-step guide on how to use kpm to push your kcl package to ghcr.io.
6+
7+
## Step 1: Install kpm
8+
9+
First, you need to install kpm on your computer. You can follow the instructions in the [kpm installation documentation](https://kcl-lang.io/docs/user_docs/guides/package-management/installation).
10+
11+
## Step 2: Create a ghcr.io token
12+
13+
If you are using the default OCI Registry of kpm, to push a kcl package to ghcr.io, you need to create a token for authentication. You can follow the instruction.
14+
15+
- [Creating a ghcr.io access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic)
16+
17+
## Step 3: Log in to ghcr.io
18+
19+
After installing kpm and creating a ghcr.io token, you need to log in to ghcr.io using kpm. You can do this using the following command:
20+
21+
```shell
22+
kpm login ghcr.io -u <USERNAME> -p <TOKEN>
23+
```
24+
25+
Where `<USERNAME>` is your GitHub username, `<TOKEN>` is the token you created in step 2
26+
27+
For more information on how to log in to ghcr.io using kpm, see [kpm login](https://kcl-lang.io/docs/reference/package-management/command-reference/login).
28+
29+
## Step 4: Push your kcl package
30+
31+
Now, you can use kpm to push your kcl package to ghcr.io.
32+
33+
### 1. A valid kcl package
34+
35+
First, you need to make sure that what you are pushing conforms to the specifications of a kcl package, i.e., it must contain valid kcl.mod and kcl.mod.lock files.
36+
37+
If you don't know how to get a valid kcl.mod and kcl.mod.lock, you can use the `kpm init` command.
38+
39+
```shell
40+
# Create a new kcl package named my_package
41+
kpm init my_package
42+
```
43+
44+
The `kpm init my_package` command will create a new kcl package `my_package` for you and create the `kcl.mod` and `kcl.mod.lock` files for this package.
45+
46+
If you already have a directory containing kcl files `exist_kcl_package`, you can use the following command to convert it into a kcl package and create valid `kcl.mod` and `kcl.mod.lock` files for it.
47+
48+
```shell
49+
# In the exist_kcl_package directory
50+
$ pwd
51+
/home/user/exist_kcl_package
52+
53+
# Run the `kpm init` command to create the `kcl.mod` and `kcl.mod.lock` files
54+
$ kpm init
55+
```
56+
57+
For more information on how to use `kpm init`, see [kpm init](https://kcl-lang.io/docs/reference/package-management/command-reference/init).
58+
59+
### 2. Pushing the KCL Package
60+
61+
You can use the following command in the root directory of your `kcl` package:
62+
63+
```shell
64+
# In the root directory of the exist_kcl_package package
65+
$ pwd
66+
/home/user/exist_kcl_package
67+
68+
# Pushing the KCL Package to Default OCI Registry
69+
$ kpm push
70+
```
71+
72+
After completing these steps, you have successfully pushed your KCL Package to the default OCI Registry.
73+
For more information on how to use `kpm push`, see [kpm push](https://kcl-lang.io/docs/reference/package-management/command-reference/push).
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Share Your Package to docker.io
2+
3+
[kpm](https://github.com/KusionStack/kpm) is a tool for managing kcl packages. This article will show you how to use kpm to push your kcl packages to docker.io.
4+
5+
Here is a simple step-by-step guide on how to use kpm to push your kcl package to docker.io.
6+
7+
## Step 1: Install kpm
8+
9+
First, you need to install kpm on your computer. You can follow the instructions in the [kpm installation documentation](https://kcl-lang.io/docs/user_docs/guides/package-management/installation).
10+
11+
## Step 2: Create a docker.io account
12+
13+
If you want to use `docker.io` as the OCI registry to share your kcl package with others, you need to create a `docker.io` account to support the push of your kcl package.
14+
15+
## Step 3: Log in to docker.io
16+
17+
You can use the following command to log in to docker.io.
18+
19+
```shell
20+
kpm login -u <USERNAME> -p <PASSWORD> docker.io
21+
```
22+
23+
Where `<USERNAME>` is your `docker.io` username, and `<PASSWORD>` is your `docker.io` password.
24+
25+
For more information on how to log in to docker.io using kpm, see [kpm login](https://kcl-lang.io/docs/reference/package-management/command-reference/login).
26+
27+
## Step 4: Push your kcl package
28+
29+
Now, you can use kpm to push your kcl package to `docker.io`.
30+
31+
### 1. A valid kcl package
32+
33+
First, you need to make sure that what you are pushing conforms to the specifications of a kcl package, i.e., it must contain valid kcl.mod and kcl.mod.lock files.
34+
35+
If you don't know how to get a valid kcl.mod and kcl.mod.lock, you can use the `kpm init` command.
36+
37+
Create a new kcl package named `my_package`.
38+
```shell
39+
kpm init my_package
40+
```
41+
42+
The `kpm init my_package` command will create a new kcl package `my_package` for you and create the `kcl.mod` and `kcl.mod.lock` files for this package.
43+
44+
If you already have a directory containing kcl files `exist_kcl_package`, you can use the following command to convert it into a kcl package and create valid `kcl.mod` and `kcl.mod.lock` files for it.
45+
46+
Run the `kpm init` command under the `exist_kcl_package` directory.
47+
```shell
48+
kpm init
49+
```
50+
51+
For more information on how to use `kpm init`, see [kpm init](https://kcl-lang.io/docs/reference/package-management/command-reference/init).
52+
53+
### 2. Pushing the KCL Package
54+
55+
You can use the following command in the root directory of your `kcl` package:
56+
57+
Run the `kpm push` command under the `exist_kcl_package` directory.
58+
```shell
59+
kpm push oci://docker.io/<USERNAME>/exist_kcl_package
60+
```
61+
62+
After completing these steps, you have successfully pushed your KCL Package `exist_kcl_package` to `docker.io`.
63+
For more information on how to use `kpm push`, see [kpm push](https://kcl-lang.io/docs/reference/package-management/command-reference/push).
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Push Your KCL Package by GitHub Action
2+
3+
[kpm](https://github.com/KusionStack/kpm) is a tool for managing kcl packages. This article will guide you how to use kpm in GitHub Action to push your kcl package to OCI registry.
4+
5+
## Step 1: Install kpm
6+
7+
At first, you need to install kpm on your computer. You can follow [kpm installation document](https://kcl-lang.io/docs/user_docs/guides/package-management/installation).
8+
9+
## Step 2: Create a GitHub account
10+
11+
If you already have a GitHub account, you can skip this step.
12+
13+
[Sign up for a new GitHub account](https://docs.github.com/en/get-started/signing-up-for-github/signing-up-for-a-new-github-account)
14+
15+
## Step 3: Create a GitHub repository for your KCL package
16+
17+
### 1. Prepare a GitHub repository for your KCL package
18+
19+
You need to prepare a GitHub repository for your KCL package.
20+
21+
[Create a GitHub repository](https://docs.github.com/en/get-started/quickstart/create-a-repo)
22+
23+
In this repository, add your KCL program, take the repository https://github.com/awesome-kusion/catalog.git as an example,
24+
25+
```bash
26+
├── .github
27+
│ └── workflows
28+
│ └── push.yaml # github action workflow
29+
├── LICENSE
30+
├── README.md
31+
├── kcl.mod # kcl.mod to define your kcl package
32+
├── kcl.mod.lock # kcl.mod.lock generated by kpm
33+
└── main.k # Your KCL program
34+
```
35+
36+
### 2. Set OCI Registry, account and password for your Github repository
37+
38+
Take docker.io as an example, you can set secrets `REG`, `REG_ACCOUNT` and `REG_TOKEN` for your repository. The value of `REG` is `docker.io`, the value of `REG_ACCOUNT` is your `docker.io` account, and the value of `REG_TOKEN` is your `docker.io` login password.
39+
40+
[Add secrets to the repository](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository)
41+
42+
If you use `ghcr.io` as `Registry`, you need to use GitHub token as secrets.
43+
44+
[Create a GitHub Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#personal-access-tokens-classic)
45+
46+
## Step 4: Add your KCL package to the repository and write github action workflow
47+
48+
Add github action file `.github/workflows/push.yml` to this repository, the content is as follows:
49+
50+
```yaml
51+
name: KPM Push Workflow
52+
53+
on:
54+
push:
55+
branches:
56+
- main
57+
58+
jobs:
59+
build:
60+
runs-on: ubuntu-latest
61+
steps:
62+
- name: Checkout
63+
uses: actions/checkout@v2
64+
65+
- name: Set up Go 1.19
66+
uses: actions/setup-go@v2
67+
with:
68+
go-version: 1.19
69+
70+
- name: Install kpm
71+
run: go install kcl-lang.io/kpm@latest
72+
73+
- name: Login and Push
74+
env:
75+
KPM_REG: ${{ secrets.REG }}
76+
KPM_REPO: ${{ secrets.REG_ACCOUNT }}
77+
run: kpm login -u ${{ secrets.REG_ACCOUNT }} -p ${{ secrets.REG_TOKEN }} ${{ secrets.REG }} && kpm push
78+
79+
- name: Run kpm project from oci registry
80+
run: kpm run oci://${{ secrets.REG }}/${{ secrets.REG_ACCOUNT }}/catalog --tag 0.0.1
81+
82+
```

0 commit comments

Comments
 (0)