Skip to content

Commit 3916b99

Browse files
committed
Add screenshots to README.md
1 parent 9da3bab commit 3916b99

10 files changed

+24
-21
lines changed
54 KB
Loading
Loading
82 KB
Loading

.github/images/4-Add-secret.png

19.7 KB
Loading

.github/images/5-Create-new-file.png

44.4 KB
Loading

.github/images/6-Commit-new-file.png

54.2 KB
Loading
59.3 KB
Loading
63.4 KB
Loading
Loading

README.md

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ These shared libraries are suitable for linking into external programs, and can
1111

1212
Click the **Use this template** button above the file listing view:
1313

14-
_[[image]]_
14+
![Template repository file listing view with "Use this template" button](.github/images/1-Use-this-template.png)
1515

1616
Enter a name for your new repository and click **Create repository from template**:
1717

18-
_[[image]]_
18+
!["Create a new repository from WL-FunctionCompile-CI-Template" screen with "Repository name" field and "Create repository from template" button](.github/images/2-Create-repository-from-template.png)
1919

2020
This will copy the contents of the template repository, including the GitHub Actions configuration and this README.md file, into a new repository in your account (or the selected organization account).
2121

@@ -38,28 +38,31 @@ Creating an entitlement requires access to the Wolfram Language.
3838
If you do not have [Wolfram Mathematica](https://www.wolfram.com/mathematica/), a [Wolfram|One](https://www.wolfram.com/wolfram-one/) subscription or another Wolfram Language product, you can sign up for a free [Wolfram Cloud Basic](https://www.wolframcloud.com/) subscription and create an entitlement from within a cloud notebook.
3939

4040
Use the [`CreateLicenseEntitlement` function](https://reference.wolfram.com/language/ref/CreateLicenseEntitlement.html) to create a new license entitlement linked to your Wolfram Account:
41-
```
41+
```wl
4242
In[1]:= entitlement = CreateLicenseEntitlement[<|
4343
"StandardKernelLimit" -> 6,
4444
"LicenseExpiration" -> Quantity[1, "Hours"],
4545
"EntitlementExpiration" -> Quantity[1, "Years"]
4646
|>]
4747
48-
Out[1]= LicenseEntitlementObject[O-WSTD-DA42-GKX4Z6NR2DSZR, <|
49-
PolicyID -> WSTD, PolicyName -> Standard, BillingInterval -> 900 seconds,
50-
KernelCosts -> <|Standard -> 4. credits per hour, Parallel -> 4. credits per hour|>,
51-
KernelLimits -> <|Standard -> 6, Parallel -> 0|>,
52-
CreationDate -> DateObject[{2021, 4, 26, 14, 28, 18.}, Instant, Gregorian, -5.],
53-
ExpirationDate -> DateObject[{2022, 4, 26, 14, 28, 18.}, Instant, Gregorian, -5.],
54-
LicenseExpirationDuration -> 1 day 0. hours
48+
Out[1]= LicenseEntitlementObject["O-WSTD-DA42-GKX4Z6NR2DSZR", <|
49+
"PolicyID" -> "WSTD", "PolicyName" -> "Standard", "BillingInterval" -> Quantity[900, "Seconds"],
50+
"KernelCosts" -> <|
51+
"Standard" -> Quantity[4., "Credits"/"Hours"],
52+
"Parallel" -> Quantity[4., "Credits"/"Hours"]
53+
|>,
54+
"KernelLimits" -> <|"Standard" -> 6, "Parallel" -> 0|>,
55+
"CreationDate" -> DateObject[{2021, 4, 26, 14, 28, 18.}, "Instant", "Gregorian", -4.],
56+
"ExpirationDate" -> DateObject[{2022, 4, 26, 14, 28, 18.}, "Instant", "Gregorian", -4.],
57+
"LicenseExpirationDuration" -> Quantity[MixedMagnitude[{0, 1.}], MixedUnit[{"Days", "Hours"}]]
5558
|>]
5659
```
5760

5861
Take note of the returned entitlement ID (`O-WSTD-DA42-GKX4Z6NR2DSZR` above); you will need it in the next step.
5962

6063
The meanings of the specified entitlement settings are:
6164
- `"StandardKernelLimit" -> 6`: Up to six kernels may run concurrently. (This means two copies of the three-OS compilation workflow.)
62-
- `"LicenseExpiration" -> Quantity[1, "Hours"]`: Each kernel may run for up to one hour.
65+
- `"LicenseExpiration" -> Quantity[1, "Hours"]`: Each kernel may run for up to one hour at a time.
6366
- `"EntitlementExpiration" -> Quantity[1, "Years"]`: The entitlement expires one year after creation. (This means you must create a new entitlement and replace the GitHub secret once a year.)
6467

6568
You may adjust these settings as needed for your use case. For more information, see the documentation for [`CreateLicenseEntitlement`](https://reference.wolfram.com/language/ref/CreateLicenseEntitlement.html).
@@ -73,13 +76,13 @@ This would involve modifying the jobs in the [workflow file](.github/workflows/c
7376
A license entitlement ID is a form of license key, and so for reasons of security should not be stored directly in the source tree of a repository, especially if that repository is public.
7477
We will instead store it in an [encrypted repository secret](https://docs.github.com/en/actions/reference/encrypted-secrets) that can be accessed by code running in GitHub Actions jobs.
7578

76-
Open the **Actions secrets** repository settings page (Settings > Secrets > Actions) and click **New repository secret**:
79+
Open the **Actions secrets** repository settings page (**Settings > Secrets > Actions**) and click **New repository secret**:
7780

78-
_[[image]]_
81+
!["Settings > Secrets > Actions" screen with "New repository secret" button](.github/images/3-New-repository-secret.png)
7982

8083
Name the new secret `WOLFRAM_LICENSE_ENTITLEMENT_ID` and paste your entitlement ID from step 2 as the value, then click **Add secret**:
8184

82-
_[[image]]_
85+
!["Actions secrets / New secret" screen with "Name" and "Value" fields and "Add secret" button](.github/images/4-Add-secret.png)
8386

8487
Make sure to remove any extraneous whitespace from either side of the entitlement ID.
8588

@@ -92,13 +95,13 @@ Files in subdirectories of `/functions` (e.g. `/functions/subdir/file.wl`) are i
9295

9396
Each function source file (e.g. [`/functions/addone.wl`](functions/addone.wl)) should return a [`Function`](https://reference.wolfram.com/language/ref/Function.html) expression with the appropriate [type annotations](https://reference.wolfram.com/language/ref/Typed.html) for compilation with [`FunctionCompile`](https://reference.wolfram.com/language/ref/FunctionCompile.html)/[`FunctionCompileExportLibrary`](https://reference.wolfram.com/language/ref/FunctionCompileExportLibrary.html).
9497

95-
You can commit a new function source file to your repository using the [Git command-line interface](https://docs.github.com/en/github/managing-files-in-a-repository/adding-a-file-to-a-repository-using-the-command-line) or a graphical Git tool like [GitHub Desktop](https://desktop.github.com/),
98+
You can commit and push a new function source file to your repository using the [Git command-line interface](https://docs.github.com/en/github/managing-files-in-a-repository/adding-a-file-to-a-repository-using-the-command-line) or a graphical Git tool like [GitHub Desktop](https://desktop.github.com/),
9699
or you can use [the GitHub web interface](https://docs.github.com/en/github/managing-files-in-a-repository/creating-new-files).
97100
The web interface is the easiest option for a quick test of your newly configured repository.
98101

99-
Navigate to the [`/functions`](functions) directory and click **Add file > Create new file**:
102+
Navigate to the [`/functions`](functions) directory listing and click **Add file > Create new file**:
100103

101-
_[[image]]_
104+
!["/functions" directory listing with "Add file > Create new file" button](.github/images/5-Create-new-file.png)
102105

103106
Name the file `power.wl` and paste the following as its contents:
104107
```wl
@@ -107,23 +110,23 @@ Function[Typed[num, "MachineInteger"], num ^ num]
107110

108111
Optionally edit the commit message, and then click **Commit new file**:
109112

110-
_[[image]]_
113+
!["Commit new file" screen showing new file named "power.wl" with "Function[...]" as contents](.github/images/6-Commit-new-file.png)
111114

112115

113116
### 5. Download and use a compiled function library
114117

115118
If you switch to the **Actions** tab, you should see the new workflow run triggered by your commit in step 4:
116119

117-
_[[image]]_
120+
!["Actions" tab showing workflow run triggered by a new commit](.github/images/7-Workflow-run-list.png)
118121

119122
Click on the run to see the status of each job in the run:
120123

121-
_[[image]]_
124+
![Workflow run screen showing details of an in-progress run](.github/images/8-Workflow-run-detail.png)
122125

123126
This initial run may take 10-15 minutes to finish.
124127
Once all jobs succeed, the produced artifacts will be displayed beneath the list of jobs:
125128

126-
_[[image]]_
129+
![Workflow run screen showing a successful run with artifacts for Linux, MacOSX, and Windows platforms](.github/images/9-Workflow-run-detail-artifacts.png)
127130

128131
Each artifact is a compressed ZIP file containing the compiled function libraries for the platform indicated in its name.
129132
Download and uncompress the artifact for your platform of choice.

0 commit comments

Comments
 (0)