Skip to content

Commit

Permalink
Refine tar ball size (#42)
Browse files Browse the repository at this point in the history
* publishing

* refein

* publishing

* publishing

* publishing

* refein

* refein

* refein

* add check

* refein

* refein

* refein

* refein

* refien

* refien

* fix

* fix

* publishing

* add

* publishing
  • Loading branch information
jackalcooper authored Sep 30, 2021
1 parent a0ab40d commit 151a0a5
Show file tree
Hide file tree
Showing 51 changed files with 447 additions and 1,641 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ jobs:
3.6
- name: Upload bin
if: ${{ !fromJson(matrix.cache-hit) && matrix.test-type != 'do-nothing' }}
uses: ./degist/upload
uses: ./digest/upload
with:
digest: ${{ steps.save-cache.outputs.build-digest }}
entry: ${{ matrix.entry }}
Expand All @@ -265,7 +265,7 @@ jobs:
dst-dir: bin
- name: Upload whl
if: ${{ !fromJson(matrix.cache-hit) && matrix.test-type != 'do-nothing' }}
uses: ./degist/upload
uses: ./digest/upload
with:
digest: ${{ steps.save-cache.outputs.build-digest }}
entry: ${{ matrix.entry }}
Expand Down Expand Up @@ -387,7 +387,7 @@ jobs:
exit 1
- name: Download wheel and binary
if: ${{ !fromJson(matrix.cache-hit) && matrix.test-type != 'do-nothing' }}
uses: ./degist/download
uses: ./digest/download
id: download-digest
with:
digest: ${{ steps.save-cache.outputs.build-digest }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,4 @@ lib/**/*

# oneflow
/log
oneflow-src
22 changes: 22 additions & 0 deletions __tests__/action.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import * as process from 'process'
import {test} from '@jest/globals'
import os from 'os'
import * as actionMeta from '../src/utils/actionMeta'
import {setTestMatrix} from '../src/utils/matrix'

process.env['RUNNER_TOOL_CACHE'] = '~/runner_tool_cache'.replace(
'~',
os.homedir
)
process.env['RUNNER_TEMP'] = '~/runner_temp'.replace('~', os.homedir)
process.env['GITHUB_REPOSITORY'] = 'jest-test/jest-test'
const MINUTES15 = 1000 * 60 * 15
// shows how the runner will run a javascript action with env / stdout protocol

test(
'cache test matrix',
async () => {
await actionMeta.checkAction()
},
MINUTES15
)
29 changes: 8 additions & 21 deletions __tests__/cache-complete.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ import os from 'os'
import * as env from '../src/utils/env'
import {ok} from 'assert'
import * as cpExec from '../src/utils/cpExec'
import {
checkComplete,
getOneFlowBuildCacheKeys,
removeComplete
} from '../src/utils/cache'
import * as cache from '../src/utils/cache'
import * as matrix from '../src/utils/matrix'
process.env['RUNNER_TOOL_CACHE'] = '~/runner_tool_cache'.replace(
'~',
Expand All @@ -31,34 +27,25 @@ test(
env.setInput('entry', ENTRY)
// TODO: test multiple types of digest
env.setInput('digest-type', 'single-client-test')
const keys = await getOneFlowBuildCacheKeys(ENTRY)
const keys = await cache.getOneFlowBuildCacheKeys(ENTRY)
env.setBooleanInput('mark-as-completed', true)
env.setBooleanInput('check-not-completed', true)
env.setMultilineInput('runner-labels', [
'self-hosted',
'linux',
'provision'
])
await removeComplete(keys)
ok(!(await checkComplete(keys)))
await cpExec.cpExec(
np,
path.join(__dirname, '..', 'lib', 'cacheComplete.js')
)
await cache.removeComplete(keys)
ok(!(await cache.checkComplete(keys)))
await cache.cacheRun()
env.setTestState('keys', keys)
await cpExec.cpExec(
np,
path.join(__dirname, '..', 'lib', 'postCacheComplete.js')
)
await cache.postCacheRun()
process.env['OSS_ACCESS_KEY_ID'] = ''
process.env['OSS_ACCESS_KEY_SECRET'] = ''
// await new Promise(resolve => setTimeout(resolve, 2000))
ok(await checkComplete(keys))
ok(await cache.checkComplete(keys))
env.setBooleanInput('check-not-completed', false)
await cpExec.cpExec(
np,
path.join(__dirname, '..', 'lib', 'cacheComplete.js')
)
await cache.cacheRun()
},
MINUTES15
)
Expand Down
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: 'Build/Get OneFlow'
description: ''
inputs:
action-type:
description: ''
required: false
default: 'build-oneflow'
# OneFlow args
oneflow-build-env:
description: 'environment to build OneFlow: conda, manylinux'
Expand Down Expand Up @@ -100,4 +104,4 @@ outputs:
description: 'pip index url could be use to install oneflow'
runs:
using: 'node12'
main: 'dist/buildOneFlow/index.js'
main: 'dist/index.js'
10 changes: 7 additions & 3 deletions cache-complete/action.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
name: 'Build/Get OneFlow'
description: ''
inputs:
action-type:
description: ''
required: false
default: 'cache-complete'
oneflow-src:
description: 'path to OneFlow source code'
required: true
entry:
description: 'entry to cache completetion status'
description: 'entry to cache completion status'
required: true
runner-labels:
required: false
Expand All @@ -31,8 +35,8 @@ outputs:

runs:
using: 'node12'
main: '../dist/cacheComplete/index.js'
post: '../dist/postCacheComplete/index.js'
main: '../dist/index.js'
post: '../dist/index.js'
post-if: success()
branding:
icon: 'archive'
Expand Down
6 changes: 5 additions & 1 deletion cache-complete/matrix/build/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: 'Build/Get OneFlow'
description: ''
inputs:
action-type:
description: ''
required: false
default: 'cache-complete/matrix/build'
oneflow-src:
description: 'path to OneFlow source code'
required: true
Expand All @@ -16,7 +20,7 @@ outputs:

runs:
using: 'node12'
main: '../../../dist/genBuildMatrix/index.js'
main: '../../../dist/index.js'
branding:
icon: 'archive'
color: 'gray-dark'
6 changes: 5 additions & 1 deletion cache-complete/matrix/test/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: 'Build/Get OneFlow'
description: ''
inputs:
action-type:
description: ''
required: false
default: 'cache-complete/matrix/test'
oneflow-src:
description: 'path to OneFlow source code'
required: true
Expand All @@ -13,7 +17,7 @@ outputs:

runs:
using: 'node12'
main: '../../../dist/genTestMatrix/index.js'
main: '../../../dist/index.js'
branding:
icon: 'archive'
color: 'gray-dark'
6 changes: 5 additions & 1 deletion degist/download/action.yml → digest/download/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: 'Download by digest'
description: ''
inputs:
action-type:
description: ''
required: false
default: 'digest/download'
entry:
description: ''
required: true
Expand All @@ -25,7 +29,7 @@ outputs:

runs:
using: 'node12'
main: '../../dist/downloadByDigest/index.js'
main: '../../dist/index.js'
branding:
icon: 'archive'
color: 'gray-dark'
6 changes: 5 additions & 1 deletion degist/upload/action.yml → digest/upload/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: 'Upload by digest'
description: ''
inputs:
action-type:
description: ''
required: false
default: 'digest/upload'
src-dir:
description: 'path to OneFlow source code'
required: true
Expand All @@ -23,7 +27,7 @@ inputs:

runs:
using: 'node12'
main: '../../dist/uploadByDigest/index.js'
main: '../../dist/index.js'
branding:
icon: 'archive'
color: 'gray-dark'
File renamed without changes.
213 changes: 0 additions & 213 deletions dist/buildImage/index.js

This file was deleted.

213 changes: 0 additions & 213 deletions dist/buildOneFlow/index.js

This file was deleted.

211 changes: 0 additions & 211 deletions dist/cacheComplete/index.js

This file was deleted.

3 changes: 0 additions & 3 deletions dist/downloadByDigest/index.js

This file was deleted.

Binary file removed dist/downloadByDigest/pagent.exe
Binary file not shown.
211 changes: 0 additions & 211 deletions dist/genBuildMatrix/index.js

This file was deleted.

211 changes: 0 additions & 211 deletions dist/genTestMatrix/index.js

This file was deleted.

213 changes: 213 additions & 0 deletions dist/index.js

Large diffs are not rendered by default.

213 changes: 0 additions & 213 deletions dist/mirrorTools/index.js

This file was deleted.

Binary file removed dist/mirrorTools/pagent.exe
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
211 changes: 0 additions & 211 deletions dist/postCacheComplete/index.js

This file was deleted.

Binary file removed dist/uploadByDigest/build/Release/cpufeatures.node
Binary file not shown.
3 changes: 0 additions & 3 deletions dist/uploadByDigest/index.js

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file removed dist/uploadByDigest/pagent.exe
Binary file not shown.
Binary file removed dist/uploadByDigest/pagent1.exe
Binary file not shown.
6 changes: 5 additions & 1 deletion manylinux/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: 'Build/Get OneFlow'
description: ''
inputs:
action-type:
description: ''
required: false
default: 'manylinux'
manylinux-version:
description: ''
required: true
Expand All @@ -14,4 +18,4 @@ outputs:
description: 'pip index url could be use to install oneflow'
runs:
using: 'node12'
main: '../dist/buildImage/index.js'
main: '../dist/index.js'
7 changes: 6 additions & 1 deletion mirror/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: 'Mirror Tools'
description: ''
inputs:
action-type:
description: ''
required: false
default: 'mirror'
runs:
using: 'node12'
main: '../dist/mirrorTools/index.js'
main: '../dist/index.js'
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 2 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,7 @@
"format": "prettier --write **/*.ts",
"format-check": "prettier --check **/*.ts",
"lint": "eslint src/**/*.ts",
"package-buildImage": "ncc build --minify -o dist/buildImage src/buildImage.ts",
"package-buildOneFlow": "ncc build --minify -o dist/buildOneFlow src/buildOneFlow.ts",
"package-mirrorTools": "ncc build --minify -o dist/mirrorTools src/mirrorTools.ts",
"package-cacheComplete": "ncc build --minify -o dist/cacheComplete src/cacheComplete.ts",
"package-postCacheComplete": "ncc build --minify -o dist/postCacheComplete src/postCacheComplete.ts",
"package-genBuildMatrix": "ncc build --minify -o dist/genBuildMatrix src/genBuildMatrix.ts",
"package-genTestMatrix": "ncc build --minify -o dist/genTestMatrix src/genTestMatrix.ts",
"package-uploadByDigest": "ncc build --minify -o dist/uploadByDigest src/uploadByDigest.ts",
"package-downloadByDigest": "ncc build --minify -o dist/downloadByDigest src/downloadByDigest.ts",
"package-main": "ncc build --minify -o dist src/main.ts",
"package": "concurrently 'npm:package-*'",
"test": "jest",
"all": "npm run build && npm run format && npm run lint && npm run package && npm test",
Expand Down Expand Up @@ -54,6 +46,7 @@
"devDependencies": {
"@types/ali-oss": "^6.0.10",
"@types/dockerode": "^3.2.7",
"@types/js-yaml": "^4.0.3",
"@types/node": "^16.3.3",
"@types/semver": "^7.3.8",
"@types/ssh2": "^0.5.48",
Expand Down
20 changes: 0 additions & 20 deletions src/buildImage.ts

This file was deleted.

4 changes: 1 addition & 3 deletions src/buildOneFlow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ async function buildWithConda(): Promise<void> {
}
}

async function run(): Promise<void> {
export async function buildWithCondaOrManyLinux(): Promise<void> {
try {
const buildEnv: string = core.getInput('oneflow-build-env')
if (['conda', 'manylinux'].includes(buildEnv) === false) {
Expand All @@ -106,5 +106,3 @@ async function run(): Promise<void> {
core.setFailed(error as Error)
}
}

run()
28 changes: 0 additions & 28 deletions src/cacheComplete.ts

This file was deleted.

4 changes: 0 additions & 4 deletions src/downloadByDigest.ts

This file was deleted.

4 changes: 0 additions & 4 deletions src/genBuildMatrix.ts

This file was deleted.

4 changes: 0 additions & 4 deletions src/genTestMatrix.ts

This file was deleted.

Loading

0 comments on commit 151a0a5

Please sign in to comment.