Update alpine image, fixup for Makefile, fixup for benchmark

pull/1/head
Evgeniy Kulikov 2020-01-16 10:54:22 +03:00
parent 9789dcb2b6
commit d4b45131cd
No known key found for this signature in database
GPG Key ID: BF6AEE0A2A699BF2
3 changed files with 17 additions and 12 deletions

View File

@ -1,4 +1,4 @@
FROM golang:1.11-alpine3.8 as builder
FROM golang:1-alpine as builder
RUN set -x \
&& apk add --no-cache \
@ -28,7 +28,7 @@ RUN set -x \
&& go build -mod=vendor -o /go/bin/homo ./cmd/homo/main.go
# Executable image
FROM alpine:3.8
FROM alpine:3.11
WORKDIR /fixtures

View File

@ -4,7 +4,8 @@ R=\033[0m
NAME ?= homo
.PHONY: help attach auto up down
.PHONY: help attach auto up down deps
# Show this help prompt
help:
@echo ' Usage:'
@ -15,22 +16,28 @@ help:
@echo ''
@awk '/^#/{ comment = substr($$0,3) } comment && /^[a-zA-Z][a-zA-Z0-9_-]+ ?:/{ print " ", $$1, comment }' $(MAKEFILE_LIST) | column -t -s ':' | grep -v 'IGNORE' | sort | uniq
# Install dependencies
deps:
@go mod tidy -v
@go mod vendor
# Auto Tillich-Zémor hasher demo
auto: down
auto: down deps
@echo "\n${B}${G}build container${R}\n"
@time docker build -t poc-demo .
@echo "\n${B}${G}Bootup container:${R}\n"
@time docker run -d --rm -it --name hash-demo poc-demo:latest sh
@bash ./auto.sh
@make down
# Stop demo container
down:
@echo "\n${B}${G}Stop container${R}\n"
@docker stop hash-demo || true
@docker rm hash-demo || true
@docker kill hash-demo || true
@docker rm -f hash-demo || true
# Run Tillich-Zémor hasher demo
up: down
up: down deps
@echo "\n${B}${G}build container${R}\n"
@time docker build -t poc-demo .
@echo "\n${B}${G}enter inside container:${R}\n"

View File

@ -1,13 +1,11 @@
#!/bin/bash
#tmpfile=$(mktemp /tmp/random-file.XXXXXX)
#size=$1
#dd if=/dev/urandom of=$tmpfile bs=$size count=1
tmpfile=$1
tmpfile=$(mktemp /tmp/random-file.XXXXXX)
dd if=/dev/urandom of=$tmpfile bs=$1 count=1
go build ./cmd/tzsum && \
for impl in avx avx2 avx2inline purego; do
echo $impl implementation:
/usr/bin/env time -f "time: %e seconds" ./tzsum -name $tmpfile -impl $impl
/usr/bin/env time ./tzsum -name $tmpfile -impl $impl
echo
done