Skip to content

Commit

Permalink
migrate to TWGC (#198)
Browse files Browse the repository at this point in the history
Signed-off-by: DavidLiu <david.yx.liu@oracle.com>
  • Loading branch information
David Liu committed Aug 16, 2021
1 parent 877a535 commit c3a43b5
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 47 deletions.
3 changes: 1 addition & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ node_modules
fabric-samples
.vscode
.gitignore
fabrictape
todo

config.yaml
organizations
mocktmp
52 changes: 52 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: release latest

on:
push:
branches: ["master", "alpha"]
tags: "v*"
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Log in to the Container registry
uses: docker/login-action@master
with:
registry: ${{ env.REGISTRY }}
username: davidkhala
password: ${{ secrets.TWGC_DAVIDKHALA }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@master
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=edge,branch=alpha
type=ref,event=tag
- if: github.ref != 'refs/heads/master'
name: Build and push Docker image
uses: docker/build-push-action@master
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- if: github.ref == 'refs/heads/master'
name: Build and push Docker image
uses: docker/build-push-action@master
with:
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
labels: ${{ steps.meta.outputs.labels }}
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ BASE_VERSION = 0.0.2
PREV_VERSION = 0.0.1

PROJECT_NAME = tape
DOCKERIMAGE = guoger/tape
DOCKERIMAGE = ghcr.io/hyperledger-twgc/tape
export DOCKERIMAGE
EXTRA_VERSION ?= $(shell git rev-parse --short HEAD)
BuiltTime ?= $(shell date)
PROJECT_VERSION=$(BASE_APISERVER_VERSION)-snapshot-$(EXTRA_VERSION)

PKGNAME = github.com/guoger/$(PROJECT_NAME)
PKGNAME = github.com/hyperledger-twgc/$(PROJECT_NAME)
CGO_FLAGS = CGO_CFLAGS=" "
ARCH=$(shell go env GOARCH)
MARCH=$(shell go env GOOS)-$(shell go env GOARCH)
Expand All @@ -42,7 +42,7 @@ tape:
.PHONY: docker
docker:
@echo "Building tape docker......"
docker build .
docker build . --tag=ghcr.io/hyperledger-twgc/tape

.PHONY: unit-test
unit-test:
Expand Down
2 changes: 1 addition & 1 deletion README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Tape由负载生成器客户端和观察者客户端组成。因此Tape仅可以

如果你想详细了解 Tape 工作流程,请参考[工作流程](docs/workflow.md)

如果你在使用过程中遇到了问题请参考[FAQ](docs/FAQ.md),如果 FAQ 还不能解决你的问题,请在 github 中提 issue,或者发邮件咨询项目维护者。
如果你在使用过程中遇到了问题请参考[FAQ](https://github.com/Hyperledger-TWGC/tape/wiki/FAQ),如果 FAQ 还不能解决你的问题,请在 github 中提 issue,或者发邮件咨询项目维护者。


## [如何贡献](CONTRIBUTING.md)
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ Our main focus is to make sure that *tape will not be the bottleneck of performa
### Install

You could get `tape` in three ways:
1. Download binary: get release tar from [release page](https://github.com/guoger/tape/releases), and extract `tape` binary from it
1. Download binary: get release tar from [release page](https://github.com/hyperledger-twgc/tape/releases), and extract `tape` binary from it
2. Build from source: clone this repo and run `make tape` at root dir. Go1.14 or higher is required. `tape` binary will be available at project root directory.
3. Pull docker image: `docker pull guoger/tape`
3. Pull docker image: `docker pull ghcr.io/hyperledger-twgc/tape`

### [Configure](docs/configfile.md)

Expand All @@ -49,7 +49,8 @@ Execute `./tape -c config.yaml -n 40000` to generate 40000 transactions to Fabri
#### Docker

```
docker run -v $PWD:/tmp guoger/tape tape -c $CONFIG_FILE -n 40000
docker run -v $PWD:/tmp ghcr.io/hyperledger-twgc/tape tape -c $CONFIG_FILE -n 40000
```

*Set this to integer times of batchsize, so that last block is not cut due to timeout*. For example, if you have batch size of 500, set this to 500, 1000, 40000, 100000, etc.
Expand Down
52 changes: 26 additions & 26 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ jobs:
strategy:
matrix:
linux:
imageName: 'ubuntu-latest'
imageName: "ubuntu-latest"
mac:
imageName: 'macOS-latest'
# windows:
# imageName: 'windows-latest'
imageName: "macOS-latest"
# windows:
# imageName: 'windows-latest'
displayName: ut
pool:
vmImage: $(imageName)
Expand All @@ -38,7 +38,7 @@ jobs:
displayName: install make tool
- task: GoTool@0
inputs:
version: '1.14'
version: "1.14"
displayName: install go
- script: make basic-checks
displayName: run basic checks like linter
Expand All @@ -52,34 +52,34 @@ jobs:
- job: dockerbuild
displayName: dockerbuild
steps:
- script: make docker
displayName: build tape docker
- script: make docker
displayName: build tape docker

- job: integrationTest
displayName: integrationTest
dependsOn:
- ut
- dockerbuild
- ut
- dockerbuild
strategy:
matrix:
FABRIC_2_2:
FABRIC_VERSION: '2_2'
INTERGATION_CASE: 'ANDLogic'
FABRIC_VERSION: "2_2"
INTERGATION_CASE: "ANDLogic"
FABRIC_2_2_ORLogic:
FABRIC_VERSION: '2_2'
INTERGATION_CASE: 'ORLogic'
FABRIC_VERSION: "2_2"
INTERGATION_CASE: "ORLogic"
FABRIC_2_3:
FABRIC_VERSION: '2_3'
INTERGATION_CASE: 'ANDLogic'
FABRIC_VERSION: "2_3"
INTERGATION_CASE: "ANDLogic"
FABRIC_2_3_ORLogic:
FABRIC_VERSION: '2_3'
INTERGATION_CASE: 'ORLogic'
FABRIC_VERSION: "2_3"
INTERGATION_CASE: "ORLogic"
FABRIC_1_4:
FABRIC_VERSION: '1_4'
INTERGATION_CASE: 'ANDLogic'
FABRIC_VERSION: "1_4"
INTERGATION_CASE: "ANDLogic"
LATEST:
FABRIC_VERSION: 'latest'
INTERGATION_CASE: 'ANDLogic'
FABRIC_VERSION: "latest"
INTERGATION_CASE: "ANDLogic"
steps:
- script: make integration-test FABRIC_VERSION=$(FABRIC_VERSION) INTERGATION_CASE=$(INTERGATION_CASE)

Expand All @@ -91,12 +91,12 @@ jobs:
- script: GOOS=linux GOARCH=amd64 make tape && cp tape linux-amd64 && cp config.yaml linux-amd64 && tar -czvf "tape-linux-amd64.tar.gz" linux-amd64 && GOOS=darwin GOARCH=amd64 make tape && cp tape darwin-amd64 && cp config.yaml darwin-amd64 && tar -czvf "tape-darwin-amd64.tar.gz" darwin-amd64 && GOOS=windows GOARCH=amd64 make tape && cp tape windows-amd64 && cp config.yaml windows-amd64 && tar -czvf "tape-windows-amd64.tar.gz" windows-amd64
displayName: Compile Binary and Create Tarball
- task: GithubRelease@0
displayName: 'Create GitHub Release'
displayName: "Create GitHub Release"
inputs:
repositoryName: '$(Build.Repository.Name)'
repositoryName: "$(Build.Repository.Name)"
gitHubConnection: github.com_stone-ch
action: 'create'
tagSource: 'auto'
tagPattern: 'v.*'
action: "create"
tagSource: "auto"
tagPattern: "v.*"
assets: |
./*.tar.gz
4 changes: 0 additions & 4 deletions docs/FAQ.md

This file was deleted.

12 changes: 4 additions & 8 deletions docs/gettingstarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

你可以通过以下三种方式安装 `tape`

1. **下载二进制文件**:从[这里](https://github.com/guoger/tape/releases)下载 tar 包,并解压。
1. **下载二进制文件**:从[这里](https://github.com/hyperledger-twgc/tape/releases)下载 tar 包,并解压。

2. **本地编译**:克隆本仓库并在根目录运行如下命令进行编译:

Expand All @@ -27,22 +27,18 @@
3. **拉取 Docker 镜像**:

```
docker pull guoger/tape
docker pull ghcr.io/hyperledger-twgc/tape
```

## 编译 Docker(可选)

Tape docker镜像下载
```shell
docker pull guoger/tape
```
Tape 支持本地编译 Docker 镜像,在项目根目录下执行以下命令即可:

```shell
docker build -t guoger/tape:latest .
make docker
```

执行成功之后本地会增加一个 guoger/tape:latest 的 Docker 镜像。
执行成功之后本地会增加一个 ghcr.io/hyperledger-twgc/tape:latest 的 Docker 镜像。

## 修改配置文件

Expand Down

0 comments on commit c3a43b5

Please sign in to comment.