Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
66 changes: 55 additions & 11 deletions .github/workflows/pack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,33 +19,77 @@ jobs:
steps:
- uses: actions/checkout@v1

- uses: actions-rs/cargo@v1
# Create oci-archive
- name: Install Intel MKL
run: |
apt update
apt install -y cpio
./install-mkl.sh
- name: Create oci-archive using intel-mkl-pack
uses: actions-rs/cargo@v1
with:
command: run
args: --release

# Deploy to GitHub container reigstry (ghcr.io)
- name: Install ocipkg-cli
if: github.event_name != 'pull_request'
uses: actions-rs/cargo@v1
with:
command: install
args: ocipkg-cli --version=~0.2
- name: Add path
if: github.event_name != 'pull_request'
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH

- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
run: |
ocipkg login -u ${{ github.repository_owner }} -p ${{ github.token }} https://ghcr.io

- name: Install Intel MKL
- name: Push oci-archives
if: github.event_name != 'pull_request'
run: |
apt update
apt install -y cpio
./install-mkl.sh
ocipkg push mkl-static-lp64-seq.tar
ocipkg push mkl-static-lp64-iomp.tar
ocipkg push mkl-static-ilp64-seq.tar
ocipkg push mkl-static-ilp64-iomp.tar

- name: Create oci-archive using intel-mkl-pack
uses: actions-rs/cargo@v1
windows:
runs-on: windows-2022
steps:
- uses: actions/checkout@v1

# Create oci-archive
- name: Get MKL using NuGet
run: |
nuget install intelmkl.devel.cluster.win-x64 -Version 2022.0.3.171
nuget install intelmkl.static.cluster.win-x64 -Version 2022.0.3.171
- uses: actions-rs/cargo@v1
with:
command: run
args: --release
env:
MKLROOT: ${{ github.workspace }}

# Deploy to GitHub container reigstry (ghcr.io)
- uses: actions-rs/cargo@v1
if: github.event_name != 'pull_request'
name: Install ocipkg-cli
with:
command: install
args: ocipkg-cli --version=~0.2
- name: Add path
if: github.event_name != 'pull_request'
run: echo "$HOME/.cargo/bin" >> $Env:GITHUB_PATH
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
run: |
ocipkg login -u ${{ github.repository_owner }} -p ${{ github.token }} https://ghcr.io
- name: Push oci-archives
if: github.event_name != 'pull_request'
run: >-
for ar in $(find . -name "mkl-*-*-*.tar"); do
ocipkg push $ar;
done
run: |
ocipkg push mkl-static-lp64-seq.tar
ocipkg push mkl-static-lp64-iomp.tar
ocipkg push mkl-static-ilp64-seq.tar
ocipkg push mkl-static-ilp64-iomp.tar
10 changes: 6 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ use std::{
time::Instant,
};

const REGISTRY: &str = "ghcr.io/rust-math/rust-mkl";

fn main() -> Result<()> {
let run_id: u64 = std::env::var("GITHUB_RUN_ID")
.unwrap_or_else(|_| "0".to_string()) // fallback value for local testing
Expand All @@ -27,8 +25,12 @@ fn main() -> Result<()> {
let lib = Library::new(cfg)?;
let (year, _, update) = lib.version()?;
let name = ImageName::parse(&format!(
"{}/{}:{}.{}-{}",
REGISTRY, cfg, year, update, run_id
"ghcr.io/rust-math/rust-mkl/{}/{}:{}.{}-{}",
std::env::consts::OS,
cfg,
year,
update,
run_id
))?;
let output = format!("{}.tar", cfg);

Expand Down