env: delete more unused environments
The s390x cross-compile builder was used for releases before Go 1.21.
Releases can be cross-compiled without needing cgo now. Other -cross
builders didn't exist recently.
The JS and WASI builders are now implemented by taking a Linux image
and fetching the test execution runtime from CIPD.
Change-Id: Ie6a6cb983a95e75d501093209855c593cdfec2cf
Reviewed-on: https://go-review.googlesource.com/c/build/+/672215
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
diff --git a/env/crosscompile/linux-armel-cross/Dockerfile b/env/crosscompile/linux-armel-cross/Dockerfile
deleted file mode 100644
index b42ce25..0000000
--- a/env/crosscompile/linux-armel-cross/Dockerfile
+++ /dev/null
@@ -1,57 +0,0 @@
-# Copyright 2016 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-# Debian buildlet image with cross compilers for linux-arm-arm5.
-# Docker tag gobuilders/linux-armel-stretch
-
-FROM golang/buildlet-stage0 AS stage0
-
-FROM debian:buster
-MAINTAINER golang-dev <golang-dev@googlegroups.com>
-
-ENV DEBIAN_FRONTEND noninteractive
-
-# curl: for getting and unpacking Go 1.4 source
-# git-core: for interacting with the Go source & subrepos
-# gcc, libc-dev: for building Go's bootstrap 'dist' prog
-# gcc-arm-linux-gnueabi, libc6-dev-armel-cross: for armel builds
-# linux-libc-dev(armel): for asm/errno.h
-# procps, lsof, psmisc: misc tools
-RUN dpkg --add-architecture armel \
- && apt-get update && apt-get install -y \
- bzip2 \
- ca-certificates \
- curl \
- git-core \
- gcc \
- libc6-dev \
- gcc-arm-linux-gnueabi \
- libc6-dev-armel-cross \
- linux-libc-dev:armel \
- procps \
- lsof \
- psmisc \
- sudo \
- --no-install-recommends \
- && rm -rf /var/lib/apt/lists/*
-
-RUN mkdir -p /go1.4-amd64 \
- && ( \
- curl --silent https://storage.googleapis.com/golang/go1.4.3.linux-amd64.tar.gz | tar -C /go1.4-amd64 -zxv \
- ) \
- && mv /go1.4-amd64/go /go1.4 \
- && rm -rf /go1.4-amd64 \
- && rm -rf /go1.4/pkg/linux_amd64_race \
- /go1.4/api \
- /go1.4/blog \
- /go1.4/doc \
- /go1.4/misc \
- /go1.4/test \
- && find /go1.4 -type d -name testdata | xargs rm -rf
-
-COPY --from=stage0 /go/bin/* /usr/local/bin/
-
-ENV GOROOT_BOOTSTRAP=/go1.4 GOOS=linux GOARCH=arm CC_FOR_TARGET=arm-linux-gnueabi-gcc
-
-CMD ["/usr/local/bin/run-worker.sh"]
diff --git a/env/crosscompile/linux-armel-cross/Makefile b/env/crosscompile/linux-armel-cross/Makefile
deleted file mode 120000
index 2ed8383..0000000
--- a/env/crosscompile/linux-armel-cross/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../../shared-makefile/Makefile
\ No newline at end of file
diff --git a/env/crosscompile/linux-armel-cross/README b/env/crosscompile/linux-armel-cross/README
deleted file mode 100644
index 3081978..0000000
--- a/env/crosscompile/linux-armel-cross/README
+++ /dev/null
@@ -1,2 +0,0 @@
-The docker image created from this directory can be used to cross compile go
-from linux/amd64 to linux/armel.
diff --git a/env/crosscompile/linux-armhf-cross/Dockerfile b/env/crosscompile/linux-armhf-cross/Dockerfile
deleted file mode 100644
index b82eb6b..0000000
--- a/env/crosscompile/linux-armhf-cross/Dockerfile
+++ /dev/null
@@ -1,55 +0,0 @@
-# Copyright 2016 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-# Linux builder VM running Debian, with cross compilers for linux-arm.
-# Docker tag gobuilders/linux-armhf-cross
-
-FROM golang/buildlet-stage0 AS stage0
-
-FROM debian:buster
-MAINTAINER golang-dev <golang-dev@googlegroups.com>
-
-ENV DEBIAN_FRONTEND noninteractive
-
-# git-core: for interacting with the Go source & subrepos
-# gcc, libc-dev: for building Go's bootstrap 'dist' prog
-# gcc-armhf-linux-gnu: for armhf builds
-# libc-dev(armhf): for asm/errno.h
-# procps, lsof, psmisc: misc tools
-RUN dpkg --add-architecture armhf \
- && apt-get update && apt-get install -y \
- bzip2 \
- ca-certificates \
- curl \
- git-core \
- gcc \
- libc6-dev \
- gcc-arm-linux-gnueabihf \
- libc-dev:armhf \
- procps \
- lsof \
- psmisc \
- sudo \
- --no-install-recommends \
- && rm -rf /var/lib/apt/lists/*
-
-RUN mkdir -p /go1.4-amd64 \
- && ( \
- curl --silent https://storage.googleapis.com/golang/go1.4.3.linux-amd64.tar.gz | tar -C /go1.4-amd64 -zxv \
- ) \
- && mv /go1.4-amd64/go /go1.4 \
- && rm -rf /go1.4-amd64 \
- && rm -rf /go1.4/pkg/linux_amd64_race \
- /go1.4/api \
- /go1.4/blog \
- /go1.4/doc \
- /go1.4/misc \
- /go1.4/test \
- && find /go1.4 -type d -name testdata | xargs rm -rf
-
-COPY --from=stage0 /go/bin/* /usr/local/bin/
-
-ENV GOROOT_BOOTSTRAP=/go1.4 GOOS=linux GOARCH=arm CC_FOR_TARGET=arm-linux-gnueabihf-gcc
-
-CMD ["/usr/local/bin/run-worker.sh"]
diff --git a/env/crosscompile/linux-armhf-cross/Makefile b/env/crosscompile/linux-armhf-cross/Makefile
deleted file mode 120000
index 2ed8383..0000000
--- a/env/crosscompile/linux-armhf-cross/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../../shared-makefile/Makefile
\ No newline at end of file
diff --git a/env/crosscompile/linux-armhf-cross/README b/env/crosscompile/linux-armhf-cross/README
deleted file mode 100644
index 5efe2ee..0000000
--- a/env/crosscompile/linux-armhf-cross/README
+++ /dev/null
@@ -1,2 +0,0 @@
-The docker image created from this directory can be used to cross compile go
-from linux/amd64 to linux/armhf.
diff --git a/env/crosscompile/linux-s390x-cross/Dockerfile b/env/crosscompile/linux-s390x-cross/Dockerfile
deleted file mode 100644
index 4b2a467..0000000
--- a/env/crosscompile/linux-s390x-cross/Dockerfile
+++ /dev/null
@@ -1,54 +0,0 @@
-# Copyright 2016 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-# Linux buildlet image with with cross compilers for linux-s390x.
-# Docker tag gobuilders/linux-s390x-cross
-
-FROM golang/buildlet-stage0 AS stage0
-
-FROM debian:buster
-MAINTAINER golang-dev <golang-dev@googlegroups.com>
-
-ENV DEBIAN_FRONTEND noninteractive
-
-# curl: for getting and unpacking Go 1.4 source
-# git-core: for interacting with the Go source & subrepos
-# gcc, libc-dev: for building Go's bootstrap 'dist' prog
-# gcc-s390x-linux-gnu, libc6-dev-s390x-cross: for s390x builds
-# procps, lsof, psmisc: misc tools
-RUN apt-get update && apt-get install -y \
- bzip2 \
- ca-certificates \
- curl \
- git-core \
- gcc \
- libc6-dev \
- gcc-s390x-linux-gnu \
- libc6-dev-s390x-cross \
- procps \
- lsof \
- psmisc \
- sudo \
- --no-install-recommends \
- && rm -rf /var/lib/apt/lists/*
-
-RUN mkdir -p /go1.4-amd64 \
- && ( \
- curl --silent https://storage.googleapis.com/golang/go1.4.3.linux-amd64.tar.gz | tar -C /go1.4-amd64 -zxv \
- ) \
- && mv /go1.4-amd64/go /go1.4 \
- && rm -rf /go1.4-amd64 \
- && rm -rf /go1.4/pkg/linux_amd64_race \
- /go1.4/api \
- /go1.4/blog \
- /go1.4/doc \
- /go1.4/misc \
- /go1.4/test \
- && find /go1.4 -type d -name testdata | xargs rm -rf
-
-COPY --from=stage0 /go/bin/* /usr/local/bin/
-
-ENV GOROOT_BOOTSTRAP=/go1.4 GOOS=linux GOARCH=s390x CC_FOR_TARGET=s390x-linux-gnu-gcc
-
-CMD ["/usr/local/bin/run-worker.sh"]
diff --git a/env/crosscompile/linux-s390x-cross/Makefile b/env/crosscompile/linux-s390x-cross/Makefile
deleted file mode 120000
index 2ed8383..0000000
--- a/env/crosscompile/linux-s390x-cross/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../../shared-makefile/Makefile
\ No newline at end of file
diff --git a/env/crosscompile/linux-s390x-cross/README b/env/crosscompile/linux-s390x-cross/README
deleted file mode 100644
index afc68ed..0000000
--- a/env/crosscompile/linux-s390x-cross/README
+++ /dev/null
@@ -1,2 +0,0 @@
-The docker image created from this directory can be used to cross compile go
-from linux/amd64 to linux/s390x.
diff --git a/env/js-wasm-node18/Dockerfile b/env/js-wasm-node18/Dockerfile
deleted file mode 100644
index a07b880..0000000
--- a/env/js-wasm-node18/Dockerfile
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright 2022 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-FROM {{REPO}}/linux-x86-sid:20221109
-LABEL maintainer="golang-dev@googlegroups.com"
-
-ENV DEBIAN_FRONTEND noninteractive
-
-# A copy of https://deb.nodesource.com/setup_18.x.
-COPY setup_18.x setup_18.x
-
-RUN bash setup_18.x && \
- apt-get install -y nodejs && \
- rm -rf setup_18.x /var/lib/apt/lists/*
-
-CMD ["/usr/local/bin/stage0"]
diff --git a/env/js-wasm-node18/Makefile b/env/js-wasm-node18/Makefile
deleted file mode 100644
index 7ebbb1f..0000000
--- a/env/js-wasm-node18/Makefile
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2022 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-IMAGE_NAME=$(shell basename $(CURDIR))
-PROD_REPO=gcr.io/symbolic-datum-552
-
-usage:
- echo "Use prod or dev targets. For dev, specify your Docker repository with the REPO=foo argument." ; exit 1
-
-prod: Dockerfile
- sed 's|{{REPO}}|'"$(PROD_REPO)"'|g' Dockerfile > Dockerfile.make
- docker build -t $(PROD_REPO)/$(IMAGE_NAME):latest -f Dockerfile.make .
-
-pushprod: prod
- docker push $(PROD_REPO)/$(IMAGE_NAME):latest
- rm Dockerfile.make
-
-# You must provide a REPO=your-repo-name arg when you make
-# this target. REPO is the name of the Docker repository
-# that will be prefixed to the name of the image being built.
-dev: Dockerfile
- sed 's|{{REPO}}|'"$(REPO)"'|g' Dockerfile > Dockerfile.make
- docker build -t $(REPO)/$(IMAGE_NAME):latest -f Dockerfile.make .
- docker push $(REPO)/$(IMAGE_NAME):latest
- rm Dockerfile.make
diff --git a/env/js-wasm-node18/setup_18.x b/env/js-wasm-node18/setup_18.x
deleted file mode 100644
index 50dd64d..0000000
--- a/env/js-wasm-node18/setup_18.x
+++ /dev/null
@@ -1,367 +0,0 @@
-#!/bin/bash
-
-# Discussion, issues and change requests at:
-# https://github.com/nodesource/distributions
-#
-# Script to install the NodeSource Node.js 18.x repo onto a
-# Debian or Ubuntu system.
-#
-# Run as root or insert `sudo -E` before `bash`:
-#
-# curl -sL https://deb.nodesource.com/setup_18.x | bash -
-# or
-# wget -qO- https://deb.nodesource.com/setup_18.x | bash -
-#
-# CONTRIBUTIONS TO THIS SCRIPT
-#
-# This script is built from a template in
-# https://github.com/nodesource/distributions/tree/master/deb/src
-# please don't submit pull requests against the built scripts.
-#
-
-
-export DEBIAN_FRONTEND=noninteractive
-SCRSUFFIX="_18.x"
-NODENAME="Node.js 18.x"
-NODEREPO="node_18.x"
-NODEPKG="nodejs"
-
-print_status() {
- echo
- echo "## $1"
- echo
-}
-
-if test -t 1; then # if terminal
- ncolors=$(which tput > /dev/null && tput colors) # supports color
- if test -n "$ncolors" && test $ncolors -ge 8; then
- termcols=$(tput cols)
- bold="$(tput bold)"
- underline="$(tput smul)"
- standout="$(tput smso)"
- normal="$(tput sgr0)"
- black="$(tput setaf 0)"
- red="$(tput setaf 1)"
- green="$(tput setaf 2)"
- yellow="$(tput setaf 3)"
- blue="$(tput setaf 4)"
- magenta="$(tput setaf 5)"
- cyan="$(tput setaf 6)"
- white="$(tput setaf 7)"
- fi
-fi
-
-print_bold() {
- title="$1"
- text="$2"
-
- echo
- echo "${red}================================================================================${normal}"
- echo "${red}================================================================================${normal}"
- echo
- echo -e " ${bold}${yellow}${title}${normal}"
- echo
- echo -en " ${text}"
- echo
- echo "${red}================================================================================${normal}"
- echo "${red}================================================================================${normal}"
-}
-
-bail() {
- echo 'Error executing command, exiting'
- exit 1
-}
-
-exec_cmd_nobail() {
- echo "+ $1"
- bash -c "$1"
-}
-
-exec_cmd() {
- exec_cmd_nobail "$1" || bail
-}
-
-node_deprecation_warning() {
- if [[ "X${NODENAME}" == "Xio.js 1.x" ||
- "X${NODENAME}" == "Xio.js 2.x" ||
- "X${NODENAME}" == "Xio.js 3.x" ||
- "X${NODENAME}" == "XNode.js 0.10" ||
- "X${NODENAME}" == "XNode.js 0.12" ||
- "X${NODENAME}" == "XNode.js 4.x LTS Argon" ||
- "X${NODENAME}" == "XNode.js 5.x" ||
- "X${NODENAME}" == "XNode.js 6.x LTS Boron" ||
- "X${NODENAME}" == "XNode.js 7.x" ||
- "X${NODENAME}" == "XNode.js 8.x LTS Carbon" ||
- "X${NODENAME}" == "XNode.js 9.x" ||
- "X${NODENAME}" == "XNode.js 10.x" ||
- "X${NODENAME}" == "XNode.js 11.x" ||
- "X${NODENAME}" == "XNode.js 12.x" ||
- "X${NODENAME}" == "XNode.js 13.x" ||
- "X${NODENAME}" == "XNode.js 15.x" ||
- "X${NODENAME}" == "XNode.js 17.x" ]]; then
-
- print_bold \
-" DEPRECATION WARNING " "\
-${bold}${NODENAME} is no longer actively supported!${normal}
-
- ${bold}You will not receive security or critical stability updates${normal} for this version.
-
- You should migrate to a supported version of Node.js as soon as possible.
- Use the installation script that corresponds to the version of Node.js you
- wish to install. e.g.
-
- * ${green}https://deb.nodesource.com/setup_14.x — Node.js 14 \"Fermium\"${normal}
- * ${green}https://deb.nodesource.com/setup_16.x — Node.js 16 \"Gallium\"${normal}
- * ${green}https://deb.nodesource.com/setup_18.x — Node.js 18 LTS \"Hydrogen\"${normal} (recommended)
- * ${green}https://deb.nodesource.com/setup_19.x — Node.js 19 \"Nineteen\"${normal} (current)
-
- Please see ${bold}https://github.com/nodejs/Release${normal} for details about which
- version may be appropriate for you.
-
- The ${bold}NodeSource${normal} Node.js distributions repository contains
- information both about supported versions of Node.js and supported Linux
- distributions. To learn more about usage, see the repository:
- ${bold}https://github.com/nodesource/distributions${normal}
-"
- echo
- echo "Continuing in 20 seconds ..."
- echo
- sleep 20
- fi
-}
-
-script_deprecation_warning() {
- if [ "X${SCRSUFFIX}" == "X" ]; then
- print_bold \
-" SCRIPT DEPRECATION WARNING " "\
-This script, located at ${bold}https://deb.nodesource.com/setup${normal}, used to
- install Node.js 0.10, is deprecated and will eventually be made inactive.
-
- You should use the script that corresponds to the version of Node.js you
- wish to install. e.g.
-
- * ${green}https://deb.nodesource.com/setup_14.x — Node.js 14 \"Fermium\"${normal}
- * ${green}https://deb.nodesource.com/setup_16.x — Node.js 16 \"Gallium\"${normal}
- * ${green}https://deb.nodesource.com/setup_18.x — Node.js 18 LTS \"Hydrogen\"${normal} (recommended)
- * ${green}https://deb.nodesource.com/setup_19.x — Node.js 19 \"Nineteen\"${normal} (current)
-
- Please see ${bold}https://github.com/nodejs/Release${normal} for details about which
- version may be appropriate for you.
-
- The ${bold}NodeSource${normal} Node.js Linux distributions GitHub repository contains
- information about which versions of Node.js and which Linux distributions
- are supported and how to use the install scripts.
- ${bold}https://github.com/nodesource/distributions${normal}
-"
-
- echo
- echo "Continuing in 20 seconds (press Ctrl-C to abort) ..."
- echo
- sleep 20
- fi
-}
-
-setup() {
-
-script_deprecation_warning
-node_deprecation_warning
-
-print_status "Installing the NodeSource ${NODENAME} repo..."
-
-if $(uname -m | grep -Eq ^armv6); then
- print_status "You appear to be running on ARMv6 hardware. Unfortunately this is not currently supported by the NodeSource Linux distributions. Please use the 'linux-armv6l' binary tarballs available directly from nodejs.org for Node.js 4 and later."
- exit 1
-fi
-
-PRE_INSTALL_PKGS=""
-
-# Check that HTTPS transport is available to APT
-# (Check snaked from: https://get.docker.io/ubuntu/)
-
-if [ ! -e /usr/lib/apt/methods/https ]; then
- PRE_INSTALL_PKGS="${PRE_INSTALL_PKGS} apt-transport-https"
-fi
-
-if [ ! -x /usr/bin/lsb_release ]; then
- PRE_INSTALL_PKGS="${PRE_INSTALL_PKGS} lsb-release"
-fi
-
-if [ ! -x /usr/bin/curl ] && [ ! -x /usr/bin/wget ]; then
- PRE_INSTALL_PKGS="${PRE_INSTALL_PKGS} curl"
-fi
-
-# Used by apt-key to add new keys
-
-if [ ! -x /usr/bin/gpg ]; then
- PRE_INSTALL_PKGS="${PRE_INSTALL_PKGS} gnupg"
-fi
-
-# Populating Cache
-print_status "Populating apt-get cache..."
-exec_cmd 'apt-get update'
-
-if [ "X${PRE_INSTALL_PKGS}" != "X" ]; then
- print_status "Installing packages required for setup:${PRE_INSTALL_PKGS}..."
- # This next command needs to be redirected to /dev/null or the script will bork
- # in some environments
- exec_cmd "apt-get install -y${PRE_INSTALL_PKGS} > /dev/null 2>&1"
-fi
-
-IS_PRERELEASE=$(lsb_release -d | grep 'Ubuntu .*development' >& /dev/null; echo $?)
-if [[ $IS_PRERELEASE -eq 0 ]]; then
- print_status "Your distribution, identified as \"$(lsb_release -d -s)\", is a pre-release version of Ubuntu. NodeSource does not maintain official support for Ubuntu versions until they are formally released. You can try using the manual installation instructions available at https://github.com/nodesource/distributions and use the latest supported Ubuntu version name as the distribution identifier, although this is not guaranteed to work."
- exit 1
-fi
-
-DISTRO=$(lsb_release -c -s)
-
-check_alt() {
- if [ "X${DISTRO}" == "X${2}" ]; then
- echo
- echo "## You seem to be using ${1} version ${DISTRO}."
- echo "## This maps to ${3} \"${4}\"... Adjusting for you..."
- DISTRO="${4}"
- fi
-}
-
-check_alt "Astra Linux" "orel" "Debian" "stretch"
-check_alt "BOSS" "anokha" "Debian" "wheezy"
-check_alt "BOSS" "anoop" "Debian" "jessie"
-check_alt "BOSS" "drishti" "Debian" "stretch"
-check_alt "BOSS" "unnati" "Debian" "buster"
-check_alt "BOSS" "urja" "Debian" "bullseye"
-check_alt "bunsenlabs" "bunsen-hydrogen" "Debian" "jessie"
-check_alt "bunsenlabs" "helium" "Debian" "stretch"
-check_alt "bunsenlabs" "lithium" "Debian" "buster"
-check_alt "Devuan" "jessie" "Debian" "jessie"
-check_alt "Devuan" "ascii" "Debian" "stretch"
-check_alt "Devuan" "beowulf" "Debian" "buster"
-check_alt "Devuan" "chimaera" "Debian" "bullseye"
-check_alt "Devuan" "ceres" "Debian" "sid"
-check_alt "Deepin" "panda" "Debian" "sid"
-check_alt "Deepin" "unstable" "Debian" "sid"
-check_alt "Deepin" "stable" "Debian" "buster"
-check_alt "Deepin" "apricot" "Debian" "buster"
-check_alt "elementaryOS" "luna" "Ubuntu" "precise"
-check_alt "elementaryOS" "freya" "Ubuntu" "trusty"
-check_alt "elementaryOS" "loki" "Ubuntu" "xenial"
-check_alt "elementaryOS" "juno" "Ubuntu" "bionic"
-check_alt "elementaryOS" "hera" "Ubuntu" "bionic"
-check_alt "elementaryOS" "odin" "Ubuntu" "focal"
-check_alt "elementaryOS" "jolnir" "Ubuntu" "focal"
-check_alt "Kali" "sana" "Debian" "jessie"
-check_alt "Kali" "kali-rolling" "Debian" "bullseye"
-check_alt "Linux Mint" "maya" "Ubuntu" "precise"
-check_alt "Linux Mint" "qiana" "Ubuntu" "trusty"
-check_alt "Linux Mint" "rafaela" "Ubuntu" "trusty"
-check_alt "Linux Mint" "rebecca" "Ubuntu" "trusty"
-check_alt "Linux Mint" "rosa" "Ubuntu" "trusty"
-check_alt "Linux Mint" "sarah" "Ubuntu" "xenial"
-check_alt "Linux Mint" "serena" "Ubuntu" "xenial"
-check_alt "Linux Mint" "sonya" "Ubuntu" "xenial"
-check_alt "Linux Mint" "sylvia" "Ubuntu" "xenial"
-check_alt "Linux Mint" "tara" "Ubuntu" "bionic"
-check_alt "Linux Mint" "tessa" "Ubuntu" "bionic"
-check_alt "Linux Mint" "tina" "Ubuntu" "bionic"
-check_alt "Linux Mint" "tricia" "Ubuntu" "bionic"
-check_alt "Linux Mint" "ulyana" "Ubuntu" "focal"
-check_alt "Linux Mint" "ulyssa" "Ubuntu" "focal"
-check_alt "Linux Mint" "uma" "Ubuntu" "focal"
-check_alt "Linux Mint" "una" "Ubuntu" "focal"
-check_alt "Linux Mint" "vanessa" "Ubuntu" "jammy"
-check_alt "Liquid Lemur" "lemur-3" "Debian" "stretch"
-check_alt "LMDE" "betsy" "Debian" "jessie"
-check_alt "LMDE" "cindy" "Debian" "stretch"
-check_alt "LMDE" "debbie" "Debian" "buster"
-check_alt "LMDE" "elsie" "Debian" "bullseye"
-check_alt "MX Linux 17" "Horizon" "Debian" "stretch"
-check_alt "MX Linux 18" "Continuum" "Debian" "stretch"
-check_alt "MX Linux 19" "patito feo" "Debian" "buster"
-check_alt "MX Linux 21" "wildflower" "Debian" "bullseye"
-check_alt "Pardus" "onyedi" "Debian" "stretch"
-check_alt "Parrot" "ara" "Debian" "bullseye"
-check_alt "PureOS" "green" "Debian" "sid"
-check_alt "PureOS" "amber" "Debian" "buster"
-check_alt "PureOS" "byzantium" "Debian" "bullseye"
-check_alt "SolydXK" "solydxk-9" "Debian" "stretch"
-check_alt "Sparky Linux" "Tyche" "Debian" "stretch"
-check_alt "Sparky Linux" "Nibiru" "Debian" "buster"
-check_alt "Sparky Linux" "Po-Tolo" "Debian" "bullseye"
-check_alt "Tanglu" "chromodoris" "Debian" "jessie"
-check_alt "Trisquel" "toutatis" "Ubuntu" "precise"
-check_alt "Trisquel" "belenos" "Ubuntu" "trusty"
-check_alt "Trisquel" "flidas" "Ubuntu" "xenial"
-check_alt "Trisquel" "etiona" "Ubuntu" "bionic"
-check_alt "Ubilinux" "dolcetto" "Debian" "stretch"
-check_alt "Uruk GNU/Linux" "lugalbanda" "Ubuntu" "xenial"
-
-if [ "X${DISTRO}" == "Xdebian" ]; then
- print_status "Unknown Debian-based distribution, checking /etc/debian_version..."
- NEWDISTRO=$([ -e /etc/debian_version ] && cut -d/ -f1 < /etc/debian_version)
- if [ "X${NEWDISTRO}" == "X" ]; then
- print_status "Could not determine distribution from /etc/debian_version..."
- else
- DISTRO=$NEWDISTRO
- print_status "Found \"${DISTRO}\" in /etc/debian_version..."
- fi
-fi
-
-print_status "Confirming \"${DISTRO}\" is supported..."
-
-if [ -x /usr/bin/curl ]; then
- exec_cmd_nobail "curl -sLf -o /dev/null 'https://deb.nodesource.com/${NODEREPO}/dists/${DISTRO}/Release'"
- RC=$?
-else
- exec_cmd_nobail "wget -qO /dev/null -o /dev/null 'https://deb.nodesource.com/${NODEREPO}/dists/${DISTRO}/Release'"
- RC=$?
-fi
-
-if [[ $RC != 0 ]]; then
- print_status "Your distribution, identified as \"${DISTRO}\", is not currently supported, please contact NodeSource at https://github.com/nodesource/distributions/issues if you think this is incorrect or would like your distribution to be considered for support"
- exit 1
-fi
-
-if [ -f "/etc/apt/sources.list.d/chris-lea-node_js-$DISTRO.list" ]; then
- print_status 'Removing Launchpad PPA Repository for NodeJS...'
-
- exec_cmd_nobail 'add-apt-repository -y -r ppa:chris-lea/node.js'
- exec_cmd "rm -f /etc/apt/sources.list.d/chris-lea-node_js-${DISTRO}.list"
-fi
-
-print_status 'Adding the NodeSource signing key to your keyring...'
-keyring='/usr/share/keyrings'
-node_key_url="https://deb.nodesource.com/gpgkey/nodesource.gpg.key"
-local_node_key="$keyring/nodesource.gpg"
-
-if [ -x /usr/bin/curl ]; then
- exec_cmd "curl -s $node_key_url | gpg --dearmor | tee $local_node_key >/dev/null"
-else
- exec_cmd "wget -q -O - $node_key_url | gpg --dearmor | tee $local_node_key >/dev/null"
-fi
-
-print_status "Creating apt sources list file for the NodeSource ${NODENAME} repo..."
-
-exec_cmd "echo 'deb [signed-by=$local_node_key] https://deb.nodesource.com/${NODEREPO} ${DISTRO} main' > /etc/apt/sources.list.d/nodesource.list"
-exec_cmd "echo 'deb-src [signed-by=$local_node_key] https://deb.nodesource.com/${NODEREPO} ${DISTRO} main' >> /etc/apt/sources.list.d/nodesource.list"
-
-print_status 'Running `apt-get update` for you...'
-
-exec_cmd 'apt-get update'
-
-yarn_site='https://dl.yarnpkg.com/debian'
-yarn_key_url="$yarn_site/pubkey.gpg"
-local_yarn_key="$keyring/yarnkey.gpg"
-
-print_status """Run \`${bold}sudo apt-get install -y ${NODEPKG}${normal}\` to install ${NODENAME} and npm
-## You may also need development tools to build native addons:
- sudo apt-get install gcc g++ make
-## To install the Yarn package manager, run:
- curl -sL $yarn_key_url | gpg --dearmor | sudo tee $local_yarn_key >/dev/null
- echo \"deb [signed-by=$local_yarn_key] $yarn_site stable main\" | sudo tee /etc/apt/sources.list.d/yarn.list
- sudo apt-get update && sudo apt-get install yarn
-"""
-
-}
-
-## Defer setup until we have the complete script
-setup
diff --git a/env/js-wasm/Dockerfile b/env/js-wasm/Dockerfile
deleted file mode 100644
index e3cdf07..0000000
--- a/env/js-wasm/Dockerfile
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright 2018 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-FROM {{REPO}}/linux-x86-sid:latest
-MAINTAINER golang-dev <golang-dev@googlegroups.com>
-
-ENV DEBIAN_FRONTEND noninteractive
-
-# A copy of https://deb.nodesource.com/setup_14.x.
-COPY setup_14.x setup_14.x
-
-RUN bash setup_14.x && \
- apt-get install -y nodejs && \
- rm -rf setup_14.x /var/lib/apt/lists/*
-
-CMD ["/usr/local/bin/stage0"]
diff --git a/env/js-wasm/Makefile b/env/js-wasm/Makefile
deleted file mode 100644
index 2927fe6..0000000
--- a/env/js-wasm/Makefile
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright 2018 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-IMAGE_NAME=$(shell basename $(CURDIR))
-STAGING_REPO=gcr.io/go-dashboard-dev
-PROD_REPO=gcr.io/symbolic-datum-552
-
-usage:
- echo "Use staging, prod, or dev targets. For dev, specify your Docker repository with the REPO=foo argument." ; exit 1
-
-staging: Dockerfile
- sed 's|{{REPO}}|'"$(STAGING_REPO)"'|g' Dockerfile > Dockerfile.make
- docker build -t $(STAGING_REPO)/$(IMAGE_NAME):latest -f Dockerfile.make .
-
-pushstaging: staging
- docker push $(STAGING_REPO)/$(IMAGE_NAME):latest
- rm Dockerfile.make
-
-prod: Dockerfile
- sed 's|{{REPO}}|'"$(PROD_REPO)"'|g' Dockerfile > Dockerfile.make
- docker build -t $(PROD_REPO)/$(IMAGE_NAME):latest -f Dockerfile.make .
-
-pushprod: prod
- docker push $(PROD_REPO)/$(IMAGE_NAME):latest
- rm Dockerfile.make
-
-# You must provide a REPO=your-repo-name arg when you make
-# this target. REPO is the name of the Docker repository
-# that will be prefixed to the name of the image being built.
-dev: Dockerfile
- sed 's|{{REPO}}|'"$(REPO)"'|g' Dockerfile > Dockerfile.make
- docker build -t $(REPO)/$(IMAGE_NAME):latest -f Dockerfile.make .
- docker push $(REPO)/$(IMAGE_NAME):latest
- rm Dockerfile.make
diff --git a/env/js-wasm/setup_14.x b/env/js-wasm/setup_14.x
deleted file mode 100644
index fe0234a..0000000
--- a/env/js-wasm/setup_14.x
+++ /dev/null
@@ -1,352 +0,0 @@
-#!/bin/bash
-
-# Discussion, issues and change requests at:
-# https://github.com/nodesource/distributions
-#
-# Script to install the NodeSource Node.js 14.x repo onto a
-# Debian or Ubuntu system.
-#
-# Run as root or insert `sudo -E` before `bash`:
-#
-# curl -sL https://deb.nodesource.com/setup_14.x | bash -
-# or
-# wget -qO- https://deb.nodesource.com/setup_14.x | bash -
-#
-# CONTRIBUTIONS TO THIS SCRIPT
-#
-# This script is built from a template in
-# https://github.com/nodesource/distributions/tree/master/deb/src
-# please don't submit pull requests against the built scripts.
-#
-
-
-export DEBIAN_FRONTEND=noninteractive
-SCRSUFFIX="_14.x"
-NODENAME="Node.js 14.x"
-NODEREPO="node_14.x"
-NODEPKG="nodejs"
-
-print_status() {
- echo
- echo "## $1"
- echo
-}
-
-if test -t 1; then # if terminal
- ncolors=$(which tput > /dev/null && tput colors) # supports color
- if test -n "$ncolors" && test $ncolors -ge 8; then
- termcols=$(tput cols)
- bold="$(tput bold)"
- underline="$(tput smul)"
- standout="$(tput smso)"
- normal="$(tput sgr0)"
- black="$(tput setaf 0)"
- red="$(tput setaf 1)"
- green="$(tput setaf 2)"
- yellow="$(tput setaf 3)"
- blue="$(tput setaf 4)"
- magenta="$(tput setaf 5)"
- cyan="$(tput setaf 6)"
- white="$(tput setaf 7)"
- fi
-fi
-
-print_bold() {
- title="$1"
- text="$2"
-
- echo
- echo "${red}================================================================================${normal}"
- echo "${red}================================================================================${normal}"
- echo
- echo -e " ${bold}${yellow}${title}${normal}"
- echo
- echo -en " ${text}"
- echo
- echo "${red}================================================================================${normal}"
- echo "${red}================================================================================${normal}"
-}
-
-bail() {
- echo 'Error executing command, exiting'
- exit 1
-}
-
-exec_cmd_nobail() {
- echo "+ $1"
- bash -c "$1"
-}
-
-exec_cmd() {
- exec_cmd_nobail "$1" || bail
-}
-
-node_deprecation_warning() {
- if [[ "X${NODENAME}" == "Xio.js 1.x" ||
- "X${NODENAME}" == "Xio.js 2.x" ||
- "X${NODENAME}" == "Xio.js 3.x" ||
- "X${NODENAME}" == "XNode.js 0.10" ||
- "X${NODENAME}" == "XNode.js 0.12" ||
- "X${NODENAME}" == "XNode.js 4.x LTS Argon" ||
- "X${NODENAME}" == "XNode.js 5.x" ||
- "X${NODENAME}" == "XNode.js 6.x LTS Boron" ||
- "X${NODENAME}" == "XNode.js 7.x" ||
- "X${NODENAME}" == "XNode.js 8.x LTS Carbon" ||
- "X${NODENAME}" == "XNode.js 9.x" ||
- "X${NODENAME}" == "XNode.js 10.x" ||
- "X${NODENAME}" == "XNode.js 11.x" ||
- "X${NODENAME}" == "XNode.js 13.x" ||
- "X${NODENAME}" == "XNode.js 15.x" ]]; then
-
- print_bold \
-" DEPRECATION WARNING " "\
-${bold}${NODENAME} is no longer actively supported!${normal}
-
- ${bold}You will not receive security or critical stability updates${normal} for this version.
-
- You should migrate to a supported version of Node.js as soon as possible.
- Use the installation script that corresponds to the version of Node.js you
- wish to install. e.g.
-
- * ${green}https://deb.nodesource.com/setup_12.x — Node.js 12 LTS \"Erbium\"${normal}
- * ${green}https://deb.nodesource.com/setup_14.x — Node.js 14 LTS \"Fermium\"${normal} (recommended)
- * ${green}https://deb.nodesource.com/setup_16.x — Node.js 16 \"Gallium\"${normal}
-
- Please see ${bold}https://github.com/nodejs/Release${normal} for details about which
- version may be appropriate for you.
-
- The ${bold}NodeSource${normal} Node.js distributions repository contains
- information both about supported versions of Node.js and supported Linux
- distributions. To learn more about usage, see the repository:
- ${bold}https://github.com/nodesource/distributions${normal}
-"
- echo
- echo "Continuing in 20 seconds ..."
- echo
- sleep 20
- fi
-}
-
-script_deprecation_warning() {
- if [ "X${SCRSUFFIX}" == "X" ]; then
- print_bold \
-" SCRIPT DEPRECATION WARNING " "\
-This script, located at ${bold}https://deb.nodesource.com/setup${normal}, used to
- install Node.js 0.10, is deprecated and will eventually be made inactive.
-
- You should use the script that corresponds to the version of Node.js you
- wish to install. e.g.
-
- * ${green}https://deb.nodesource.com/setup_12.x — Node.js 12 LTS \"Erbium\"${normal}
- * ${green}https://deb.nodesource.com/setup_14.x — Node.js 14 LTS \"Fermium\"${normal} (recommended)
- * ${green}https://deb.nodesource.com/setup_16.x — Node.js 16 \"Gallium\"${normal}
-
- Please see ${bold}https://github.com/nodejs/Release${normal} for details about which
- version may be appropriate for you.
-
- The ${bold}NodeSource${normal} Node.js Linux distributions GitHub repository contains
- information about which versions of Node.js and which Linux distributions
- are supported and how to use the install scripts.
- ${bold}https://github.com/nodesource/distributions${normal}
-"
-
- echo
- echo "Continuing in 20 seconds (press Ctrl-C to abort) ..."
- echo
- sleep 20
- fi
-}
-
-setup() {
-
-script_deprecation_warning
-node_deprecation_warning
-
-print_status "Installing the NodeSource ${NODENAME} repo..."
-
-if $(uname -m | grep -Eq ^armv6); then
- print_status "You appear to be running on ARMv6 hardware. Unfortunately this is not currently supported by the NodeSource Linux distributions. Please use the 'linux-armv6l' binary tarballs available directly from nodejs.org for Node.js 4 and later."
- exit 1
-fi
-
-PRE_INSTALL_PKGS=""
-
-# Check that HTTPS transport is available to APT
-# (Check snaked from: https://get.docker.io/ubuntu/)
-
-if [ ! -e /usr/lib/apt/methods/https ]; then
- PRE_INSTALL_PKGS="${PRE_INSTALL_PKGS} apt-transport-https"
-fi
-
-if [ ! -x /usr/bin/lsb_release ]; then
- PRE_INSTALL_PKGS="${PRE_INSTALL_PKGS} lsb-release"
-fi
-
-if [ ! -x /usr/bin/curl ] && [ ! -x /usr/bin/wget ]; then
- PRE_INSTALL_PKGS="${PRE_INSTALL_PKGS} curl"
-fi
-
-# Used by apt-key to add new keys
-
-if [ ! -x /usr/bin/gpg ]; then
- PRE_INSTALL_PKGS="${PRE_INSTALL_PKGS} gnupg"
-fi
-
-# Populating Cache
-print_status "Populating apt-get cache..."
-exec_cmd 'apt-get update'
-
-if [ "X${PRE_INSTALL_PKGS}" != "X" ]; then
- print_status "Installing packages required for setup:${PRE_INSTALL_PKGS}..."
- # This next command needs to be redirected to /dev/null or the script will bork
- # in some environments
- exec_cmd "apt-get install -y${PRE_INSTALL_PKGS} > /dev/null 2>&1"
-fi
-
-IS_PRERELEASE=$(lsb_release -d | grep 'Ubuntu .*development' >& /dev/null; echo $?)
-if [[ $IS_PRERELEASE -eq 0 ]]; then
- print_status "Your distribution, identified as \"$(lsb_release -d -s)\", is a pre-release version of Ubuntu. NodeSource does not maintain official support for Ubuntu versions until they are formally released. You can try using the manual installation instructions available at https://github.com/nodesource/distributions and use the latest supported Ubuntu version name as the distribution identifier, although this is not guaranteed to work."
- exit 1
-fi
-
-DISTRO=$(lsb_release -c -s)
-
-check_alt() {
- if [ "X${DISTRO}" == "X${2}" ]; then
- echo
- echo "## You seem to be using ${1} version ${DISTRO}."
- echo "## This maps to ${3} \"${4}\"... Adjusting for you..."
- DISTRO="${4}"
- fi
-}
-
-check_alt "SolydXK" "solydxk-9" "Debian" "stretch"
-check_alt "Kali" "sana" "Debian" "jessie"
-check_alt "Kali" "kali-rolling" "Debian" "bullseye"
-check_alt "Sparky Linux" "Tyche" "Debian" "stretch"
-check_alt "Sparky Linux" "Nibiru" "Debian" "buster"
-check_alt "MX Linux 17" "Horizon" "Debian" "stretch"
-check_alt "MX Linux 18" "Continuum" "Debian" "stretch"
-check_alt "MX Linux 19" "patito feo" "Debian" "buster"
-check_alt "Linux Mint" "maya" "Ubuntu" "precise"
-check_alt "Linux Mint" "qiana" "Ubuntu" "trusty"
-check_alt "Linux Mint" "rafaela" "Ubuntu" "trusty"
-check_alt "Linux Mint" "rebecca" "Ubuntu" "trusty"
-check_alt "Linux Mint" "rosa" "Ubuntu" "trusty"
-check_alt "Linux Mint" "sarah" "Ubuntu" "xenial"
-check_alt "Linux Mint" "serena" "Ubuntu" "xenial"
-check_alt "Linux Mint" "sonya" "Ubuntu" "xenial"
-check_alt "Linux Mint" "sylvia" "Ubuntu" "xenial"
-check_alt "Linux Mint" "tara" "Ubuntu" "bionic"
-check_alt "Linux Mint" "tessa" "Ubuntu" "bionic"
-check_alt "Linux Mint" "tina" "Ubuntu" "bionic"
-check_alt "Linux Mint" "tricia" "Ubuntu" "bionic"
-check_alt "Linux Mint" "ulyana" "Ubuntu" "focal"
-check_alt "Linux Mint" "ulyssa" "Ubuntu" "focal"
-check_alt "Linux Mint" "uma" "Ubuntu" "focal"
-check_alt "LMDE" "betsy" "Debian" "jessie"
-check_alt "LMDE" "cindy" "Debian" "stretch"
-check_alt "LMDE" "debbie" "Debian" "buster"
-check_alt "elementaryOS" "luna" "Ubuntu" "precise"
-check_alt "elementaryOS" "freya" "Ubuntu" "trusty"
-check_alt "elementaryOS" "loki" "Ubuntu" "xenial"
-check_alt "elementaryOS" "juno" "Ubuntu" "bionic"
-check_alt "elementaryOS" "hera" "Ubuntu" "bionic"
-check_alt "elementaryOS" "odin" "Ubuntu" "focal"
-check_alt "Trisquel" "toutatis" "Ubuntu" "precise"
-check_alt "Trisquel" "belenos" "Ubuntu" "trusty"
-check_alt "Trisquel" "flidas" "Ubuntu" "xenial"
-check_alt "Trisquel" "etiona" "Ubuntu" "bionic"
-check_alt "Uruk GNU/Linux" "lugalbanda" "Ubuntu" "xenial"
-check_alt "BOSS" "anokha" "Debian" "wheezy"
-check_alt "BOSS" "anoop" "Debian" "jessie"
-check_alt "BOSS" "drishti" "Debian" "stretch"
-check_alt "BOSS" "unnati" "Debian" "buster"
-check_alt "bunsenlabs" "bunsen-hydrogen" "Debian" "jessie"
-check_alt "bunsenlabs" "helium" "Debian" "stretch"
-check_alt "bunsenlabs" "lithium" "Debian" "buster"
-check_alt "Tanglu" "chromodoris" "Debian" "jessie"
-check_alt "PureOS" "green" "Debian" "sid"
-check_alt "PureOS" "amber" "Debian" "buster"
-check_alt "Devuan" "jessie" "Debian" "jessie"
-check_alt "Devuan" "ascii" "Debian" "stretch"
-check_alt "Devuan" "beowulf" "Debian" "buster"
-check_alt "Devuan" "ceres" "Debian" "sid"
-check_alt "Deepin" "panda" "Debian" "sid"
-check_alt "Deepin" "unstable" "Debian" "sid"
-check_alt "Deepin" "stable" "Debian" "buster"
-check_alt "Pardus" "onyedi" "Debian" "stretch"
-check_alt "Liquid Lemur" "lemur-3" "Debian" "stretch"
-check_alt "Astra Linux" "orel" "Debian" "stretch"
-check_alt "Ubilinux" "dolcetto" "Debian" "stretch"
-
-if [ "X${DISTRO}" == "Xdebian" ]; then
- print_status "Unknown Debian-based distribution, checking /etc/debian_version..."
- NEWDISTRO=$([ -e /etc/debian_version ] && cut -d/ -f1 < /etc/debian_version)
- if [ "X${NEWDISTRO}" == "X" ]; then
- print_status "Could not determine distribution from /etc/debian_version..."
- else
- DISTRO=$NEWDISTRO
- print_status "Found \"${DISTRO}\" in /etc/debian_version..."
- fi
-fi
-
-print_status "Confirming \"${DISTRO}\" is supported..."
-
-if [ -x /usr/bin/curl ]; then
- exec_cmd_nobail "curl -sLf -o /dev/null 'https://deb.nodesource.com/${NODEREPO}/dists/${DISTRO}/Release'"
- RC=$?
-else
- exec_cmd_nobail "wget -qO /dev/null -o /dev/null 'https://deb.nodesource.com/${NODEREPO}/dists/${DISTRO}/Release'"
- RC=$?
-fi
-
-if [[ $RC != 0 ]]; then
- print_status "Your distribution, identified as \"${DISTRO}\", is not currently supported, please contact NodeSource at https://github.com/nodesource/distributions/issues if you think this is incorrect or would like your distribution to be considered for support"
- exit 1
-fi
-
-if [ -f "/etc/apt/sources.list.d/chris-lea-node_js-$DISTRO.list" ]; then
- print_status 'Removing Launchpad PPA Repository for NodeJS...'
-
- exec_cmd_nobail 'add-apt-repository -y -r ppa:chris-lea/node.js'
- exec_cmd "rm -f /etc/apt/sources.list.d/chris-lea-node_js-${DISTRO}.list"
-fi
-
-print_status 'Adding the NodeSource signing key to your keyring...'
-keyring='/usr/share/keyrings'
-node_key_url="https://deb.nodesource.com/gpgkey/nodesource.gpg.key"
-local_node_key="$keyring/nodesource.gpg"
-
-if [ -x /usr/bin/curl ]; then
- exec_cmd "curl -s $node_key_url | gpg --dearmor | tee $local_node_key >/dev/null"
-else
- exec_cmd "wget -q -O - $node_key_url | gpg --dearmor | tee $local_node_key >/dev/null"
-fi
-
-print_status "Creating apt sources list file for the NodeSource ${NODENAME} repo..."
-
-exec_cmd "echo 'deb [signed-by=$local_node_key] https://deb.nodesource.com/${NODEREPO} ${DISTRO} main' > /etc/apt/sources.list.d/nodesource.list"
-exec_cmd "echo 'deb-src [signed-by=$local_node_key] https://deb.nodesource.com/${NODEREPO} ${DISTRO} main' >> /etc/apt/sources.list.d/nodesource.list"
-
-print_status 'Running `apt-get update` for you...'
-
-exec_cmd 'apt-get update'
-
-yarn_site='https://dl.yarnpkg.com/debian'
-yarn_key_url="$yarn_site/pubkey.gpg"
-local_yarn_key="$keyring/yarnkey.gpg"
-
-print_status """Run \`${bold}sudo apt-get install -y ${NODEPKG}${normal}\` to install ${NODENAME} and npm
-## You may also need development tools to build native addons:
- sudo apt-get install gcc g++ make
-## To install the Yarn package manager, run:
- curl -sL $yarn_key_url | gpg --dearmor | sudo tee $local_yarn_key >/dev/null
- echo \"deb [signed-by=$local_yarn_key] $yarn_site stable main\" | sudo tee /etc/apt/sources.list.d/yarn.list
- sudo apt-get update && sudo apt-get install yarn
-"""
-
-}
-
-## Defer setup until we have the complete script
-setup
diff --git a/env/wasip1-wasm-wasmedge/Dockerfile b/env/wasip1-wasm-wasmedge/Dockerfile
deleted file mode 100644
index 588a53b..0000000
--- a/env/wasip1-wasm-wasmedge/Dockerfile
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright 2023 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-ARG REPO
-
-FROM debian:latest as builder
-LABEL maintainer="golang-dev@googlegroups.com"
-
-RUN apt-get update && apt-get -y install python3 git
-
-# A copy of https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.py.
-COPY install.py install.py
-
-RUN python3 install.py --version 0.12.0
-
-FROM ${REPO}/linux-x86-sid:20221109
-
-COPY --from=builder /root/.wasmedge/bin/wasmedge /usr/local/bin/wasmedge
-COPY --from=builder /root/.wasmedge/lib/* /usr/local/lib/
-
-ENV LD_LIBRARY_PATH=/usr/local/lib
-
-CMD ["/usr/local/bin/stage0"]
diff --git a/env/wasip1-wasm-wasmedge/Makefile b/env/wasip1-wasm-wasmedge/Makefile
deleted file mode 100644
index 386325c..0000000
--- a/env/wasip1-wasm-wasmedge/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-# Copyright 2023 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-IMAGE_NAME=$(shell basename $(CURDIR))
-PROD_REPO=gcr.io/symbolic-datum-552
-
-usage:
- echo "Use prod or dev targets. For dev, specify your Docker repository with the REPO=foo argument." ; exit 1
-
-prod: Dockerfile
- docker build -t $(PROD_REPO)/$(IMAGE_NAME):latest --build-arg REPO=$(PROD_REPO) -f Dockerfile .
-
-pushprod: prod
- docker push $(PROD_REPO)/$(IMAGE_NAME):latest
-
-# You must provide a REPO=your-repo-name arg when you make
-# this target. REPO is the name of the Docker repository
-# that will be prefixed to the name of the image being built.
-dev: Dockerfile
- docker build -t $(REPO)/$(IMAGE_NAME):latest --build-arg REPO=$(REPO) -f Dockerfile .
- docker push $(REPO)/$(IMAGE_NAME):latest
diff --git a/env/wasip1-wasm-wasmedge/install.py b/env/wasip1-wasm-wasmedge/install.py
deleted file mode 100644
index b0c2907..0000000
--- a/env/wasip1-wasm-wasmedge/install.py
+++ /dev/null
@@ -1,1557 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-from __future__ import (
- division,
- print_function,
- absolute_import,
- unicode_literals,
- with_statement,
-)
-from contextlib import contextmanager
-import shutil
-import sys
-import argparse
-from os.path import expanduser, join, dirname, abspath, exists, islink, lexists, isdir
-from os import (
- getenv,
- geteuid,
- listdir,
- makedirs,
- mkdir,
- readlink,
- remove,
- getpid,
- symlink,
-)
-import tempfile
-import tarfile
-import zipfile
-import platform
-import subprocess
-import re
-import logging
-
-download_url = None
-
-# Define version specific things
-if sys.version_info[0] == 3:
- import urllib.request
-
- download_url = urllib.request.urlretrieve
-
- def reraise(tp, value=None, tb=None):
- if value is None:
- value = tp
- if value.__traceback__ is not tb:
- raise value.with_traceback(tb)
- raise value
-
-else:
- exec("def reraise(tp, value=None, tb=None):\n raise tp, value, tb\n")
-
- import urllib
-
- download_url = urllib.urlretrieve
-
-
-def show_progress(block_num, block_size, total_size):
- downloaded = block_num * block_size
-
- print(
- end=(
- "\r|%-60s|" % ("=" * int(60 * downloaded / (total_size)))
- + "%6.2f %%" % (downloaded / (total_size) * 100)
- )
- )
-
- if downloaded < total_size:
- pass
- else:
- print("Downloaded")
-
-
-@contextmanager
-def opened_w_error(filename, mode="r"):
- try:
- f = open(filename, mode)
- except IOError as err:
- logging.critical("Error opening file: %s error: %s", filename, err.strerror)
- yield None
- else:
- try:
- yield f
- finally:
- f.close()
-
-
-def _is_tarxz(filename):
- return filename.endswith(".tar.xz")
-
-
-def _is_tar(filename):
- return filename.endswith(".tar")
-
-
-def _is_targz(filename):
- return filename.endswith(".tar.gz")
-
-
-def _is_tgz(filename):
- return filename.endswith(".tgz")
-
-
-def _is_zip(filename):
- return filename.endswith(".zip")
-
-
-def extract_archive(
- from_path, ipath, to_path=None, remove_finished=False, env_file_path=None
-):
- files_extracted = []
-
- if to_path is None:
- to_path = dirname(from_path)
-
- if _is_tar(from_path):
- with tarfile.open(from_path, "r") as tar:
- tar.extractall(path=to_path)
- files_extracted = tar.getnames()
- elif _is_targz(from_path) or _is_tgz(from_path):
- with tarfile.open(from_path, "r:gz") as tar:
- tar.extractall(path=to_path)
- files_extracted = tar.getnames()
- elif _is_tarxz(from_path):
- with tarfile.open(from_path, "r:xz") as tar:
- tar.extractall(path=to_path)
- files_extracted = tar.getnames()
- elif _is_zip(from_path):
- with zipfile.ZipFile(from_path, "r") as z:
- z.extractall(to_path)
- files_extracted = z.namelist()
- else:
- reraise(ValueError("Extraction of {} not supported".format(from_path)))
-
- logging.debug("Writing installed files to %s file", env_file_path)
- with opened_w_error(env_file_path, "a") as env_file:
- if env_file is not None:
- for filename in files_extracted:
- fname = filename.replace(CONST_ipkg, ipath)
-
- # Skip if it ends with "wasmedge" as it is going to be removed at a later stage
- if fname.endswith("wasmedge") and not fname.endswith("bin/wasmedge"):
- continue
-
- # replace wasmedge folder name with include
- if is_default_path(args):
- fname = fname.replace("/lib64/", "/" + CONST_lib_dir + "/")
- if fname.endswith("/lib64"):
- fname = fname[:-5] + "lib"
- if fname.startswith("/usr") and "lib64" in fname:
- fname = fname.replace("lib64", "lib", 1)
- if "Plugin" in fname:
- if is_default_path(args):
- fname = fname.replace(
- join(ipath, CONST_lib_dir, "wasmedge/"), ""
- )
-
- fname = join(ipath, "plugin", fname)
- else:
- fname = join(ipath, CONST_lib_dir, "wasmedge", fname)
- else:
- if ipath not in fname:
- fname = join(ipath, fname)
- # replace GNUSparseFile.0 with nothing
- fname = fname.replace("/GNUSparseFile.0", "")
- # Don't append system directories
- if (not is_default_path(args)) and isdir(fname):
- continue
- env_file.write("#" + fname + "\n")
- logging.debug("Appending:%s", fname)
- else:
- logging.warning("Unable to write to env file")
-
- if remove_finished:
- remove(from_path)
-
-
-# https://stackoverflow.com/questions/1868714/
-# how-do-i-copy-an-entire-directory-of-files-
-# into-an-existing-directory-using-pyth
-def copytree(src, dst, symlinks=True, ignore=None):
- if not exists(dst):
- makedirs(dst)
- shutil.copystat(src, dst)
- lst = listdir(src)
- if ignore:
- excl = ignore(src, lst)
- lst = [x for x in lst if x not in excl]
- for item in lst:
- s = join(src, item)
- d = join(dst, item)
- if symlinks and islink(s):
- if lexists(d):
- remove(d)
- symlink(readlink(s), d)
- elif isdir(s):
- copytree(s, d, symlinks, ignore)
- else:
- shutil.copy2(s, d)
-
-
-class VersionString:
- def __init__(self, version):
- self.version = version
-
- def __str__(self):
- return self.version
-
- def __repr__(self):
- return "VersionString:" + self.version
-
- def _preprocess(self, v, separator, ignorecase):
- if ignorecase:
- v = v.lower()
- return [
- int(x)
- if x.isdigit()
- else [int(y) if y.isdigit() else y for y in re.findall("\d+|[a-zA-Z]+", x)]
- for x in re.split(separator, v)
- ]
-
- def compare(self, version2, separator=". |-", ignorecase=True):
- # return 1 if self.version > version2
- # return 0 if self.version == version2
- # return -1 if self.version < version2
- # return False if not comparable
- if "rc" in self.version and not "rc" in version2:
- a = self._preprocess(
- self.version.split("rc")[0].strip("-"), separator, ignorecase
- )
- b = b = self._preprocess(version2, separator, ignorecase)
- if ((a > b) - (a < b)) == 0:
- return -1
- else:
- return (a > b) - (a < b)
- else:
- a = self._preprocess(self.version, separator, ignorecase)
- b = self._preprocess(version2, separator, ignorecase)
- try:
- return (a > b) - (a < b)
- except:
- return False
-
-
-SUPPORTED_PLATFORM_MACHINE = {
- "Linux": ["x86_64", "amd64", "arm64", "armv8", "aarch64"],
- "Darwin": ["x86_64", "arm64", "arm"],
-}
-
-SUPPORTED_MIN_VERSION = {
- "Linux" + "x86_64": VersionString("0.9.0"),
- "Linux" + "amd64": VersionString("0.9.0"),
- "Linux" + "arm64": VersionString("0.9.0"),
- "Linux" + "armv8": VersionString("0.9.0"),
- "Linux" + "aarch64": VersionString("0.9.0"),
- "Darwin" + "x86_64": VersionString("0.9.0"),
- "Darwin" + "arm64": VersionString("0.9.0"),
- "Darwin" + "arm": VersionString("0.9.0"),
-}
-
-WASMEDGE = "WasmEdge"
-WASMEDGE_UNINSTALLER = "WasmEdge_Uninstaller"
-TENSORFLOW = "tensorflow"
-TENSORFLOW_LITE = "tensorflow_lite"
-TENSORFLOW_DEPS = "tensorflow_deps"
-TENSORFLOW_LITE_DEPS = "tensorflow_lite_deps"
-TENSORFLOW_TOOLS = "tensorflow_tools"
-IMAGE = "image"
-EXTENSIONS = [TENSORFLOW, IMAGE]
-
-SUPPORTED_EXTENSIONS = {
- "Linux" + "x86_64": EXTENSIONS,
- "Linux" + "amd64": EXTENSIONS,
- "Linux" + "arm64": EXTENSIONS,
- "Linux" + "armv8": EXTENSIONS,
- "Linux" + "aarch64": EXTENSIONS,
- "Darwin" + "x86_64": EXTENSIONS,
- "Darwin" + "arm64": [],
- "Darwin" + "arm": [],
-}
-
-SUPPORTED_EXTENSIONS_VERSION = {
- "Linux" + "x86_64" + TENSORFLOW: VersionString("0.9.0"),
- "Linux" + "x86_64" + IMAGE: VersionString("0.9.0"),
- "Linux" + "amd64" + TENSORFLOW: VersionString("0.9.0"),
- "Linux" + "amd64" + IMAGE: VersionString("0.9.0"),
- "Linux" + "arm64" + TENSORFLOW: VersionString("0.9.0"),
- "Linux" + "arm64" + IMAGE: VersionString("0.9.0"),
- "Linux" + "armv8" + TENSORFLOW: VersionString("0.9.0"),
- "Linux" + "armv8" + IMAGE: VersionString("0.9.0"),
- "Linux" + "aarch64" + TENSORFLOW: VersionString("0.9.1-beta.1"),
- "Linux" + "aarch64" + IMAGE: VersionString("0.9.1-beta.1"),
- "Darwin" + "x86_64" + TENSORFLOW: VersionString("0.10.0-alpha.1"),
- "Darwin" + "x86_64" + IMAGE: VersionString("0.10.0-alpha.1"),
- "Darwin" + "arm64" + TENSORFLOW: VersionString("0.10.0-alpha.1"),
- "Darwin" + "arm" + TENSORFLOW: VersionString("0.10.0-alpha.1"),
-}
-
-WASI_NN_OPENVINO = "wasi_nn-openvino"
-WASI_CRYPTO = "wasi_crypto"
-WASI_NN_PYTORCH = "wasi_nn-pytorch"
-WASI_NN_TENSORFLOW_LITE = "wasi_nn-tensorflowlite"
-WASMEDGE_HTTPSREQ = "wasmedge_httpsreq"
-PLUGINS_AVAILABLE = [
- WASI_NN_OPENVINO,
- WASI_CRYPTO,
- WASI_NN_PYTORCH,
- WASI_NN_TENSORFLOW_LITE,
- WASMEDGE_HTTPSREQ,
-]
-
-SUPPORTTED_PLUGINS = {
- "ubuntu20.04" + "x86_64" + WASI_CRYPTO: VersionString("0.10.1-rc.1"),
- "manylinux2014" + "x86_64" + WASI_CRYPTO: VersionString("0.10.1-rc.1"),
- "manylinux2014" + "aarch64" + WASI_CRYPTO: VersionString("0.10.1-rc.1"),
- "manylinux2014" + "arm64" + WASI_CRYPTO: VersionString("0.10.1-rc.1"),
- "ubuntu20.04" + "x86_64" + WASI_NN_OPENVINO: VersionString("0.10.1-alpha.1"),
- "ubuntu20.04" + "x86_64" + WASI_NN_PYTORCH: VersionString("0.11.1-alpha.1"),
- "manylinux2014" + "x86_64" + WASI_NN_PYTORCH: VersionString("0.11.2-alpha.1"),
- "manylinux2014"
- + "x86_64"
- + WASI_NN_TENSORFLOW_LITE: VersionString("0.11.2-alpha.1"),
- "manylinux2014"
- + "aarch64"
- + WASI_NN_TENSORFLOW_LITE: VersionString("0.11.2-alpha.1"),
- "ubuntu20.04" + "x86_64" + WASI_NN_TENSORFLOW_LITE: VersionString("0.11.2-rc.1"),
- "ubuntu20.04" + "x86_64" + WASMEDGE_HTTPSREQ: VersionString("0.11.1"),
- "manylinux2014" + "x86_64" + WASMEDGE_HTTPSREQ: VersionString("0.11.1"),
- "manylinux2014" + "aarch64" + WASMEDGE_HTTPSREQ: VersionString("0.11.1"),
-}
-
-HOME = expanduser("~")
-PATH = join(HOME, ".wasmedge")
-SHELL = getenv("SHELL", "bash").split("/")[-1]
-TEMP_PATH = join(tempfile.gettempdir(), "wasmedge." + str(getpid()))
-CONST_shell_config = None
-CONST_shell_profile = None
-CONST_env = None
-CONST_urls = None
-CONST_release_pkg = None
-CONST_ipkg = None
-CONST_lib_ext = None
-CONST_env_path = None
-CONST_lib_dir = "lib"
-
-try:
- mkdir(TEMP_PATH)
-except:
- pass
-
-
-def set_env(args, compat):
- global CONST_env, CONST_env_path, CONST_lib_dir
-
- CONST_env = """#!/bin/sh
-# wasmedge shell setup
-# affix colons on either side of $PATH to simplify matching
-case :"${1}": in
- *:"{0}/bin":*)
- ;;
- *)
- # Prepending path in case a system-installed wasmedge needs to be overridden
- if [ -n "${1}" ]; then
- export PATH="{0}/bin":$PATH
- else
- export PATH="{0}/bin"
- fi
- ;;
-esac
-case :"${2}": in
- *:"{0}/{6}":*)
- ;;
- *)
- # Prepending path in case a system-installed wasmedge libs needs to be overridden
- if [ -n "${2}" ]; then
- export {2}="{0}/{6}":${2}
- else
- export {2}="{0}/{6}"
- fi
- ;;
-esac
-case :"${3}": in
- *:"{0}/{6}":*)
- ;;
- *)
- if [ -n "${3}" ]; then
- export LIBRARY_PATH="{0}/{6}":$LIBRARY_PATH
- else
- export LIBRARY_PATH="{0}/{6}"
- fi
- ;;
-esac
-case :"${4}": in
- *:"{0}/include":*)
- ;;
- *)
- if [ -n "${4}" ]; then
- export C_INCLUDE_PATH="{0}/include":$C_INCLUDE_PATH
- else
- export C_INCLUDE_PATH="{0}/include"
- fi
- ;;
-esac
-case :"${5}": in
- *:"{0}/include":*)
- ;;
- *)
- if [ -n "${5}" ]; then
- export CPLUS_INCLUDE_PATH="{0}/include":$CPLUS_INCLUDE_PATH
- else
- export CPLUS_INCLUDE_PATH="{0}/include"
- fi
- ;;
-esac
-if [ -z ${{WASMEDGE_LIB_DIR+x}} ]; then
- export WASMEDGE_LIB_DIR="{0}/{6}"
-fi
-# Please do not edit comments below this for uninstallation purpose
-""".format(
- args.path,
- "PATH",
- compat.ld_library_path,
- "LIBRARY_PATH",
- "C_INCLUDE_PATH",
- "CPLUS_INCLUDE_PATH",
- CONST_lib_dir,
- )
-
- try:
- mkdir(args.path)
- if is_default_path(args):
- mkdir(join(args.path, "plugin"))
- except:
- pass
- CONST_env_path = join(args.path, "env")
- mode = "w+" if not exists(CONST_env_path) else "w"
- with opened_w_error(CONST_env_path, mode) as env:
- if env is not None:
- env.write(CONST_env)
- else:
- logging.error("Not able to write to env file")
-
-
-def shell_configure(args, compat):
- global CONST_shell_profile, CONST_shell_config
-
- source_string = '\n. "{0}"\n'.format(join(args.path, "env"))
-
- if ("bash" in SHELL) or ("zsh" in SHELL):
- CONST_shell_config = join(HOME, "." + SHELL + "rc")
-
- if "zsh" in SHELL:
- CONST_shell_profile = join(HOME, "." + "zprofile")
- else:
- CONST_shell_profile = join(HOME, "." + SHELL + "_profile")
-
- # On Darwin: Create shell config only if shell_profile does not exist
- # On Linux: Create shell config anyway
- if not exists(CONST_shell_config) and compat.platform != "Darwin":
- open(CONST_shell_config, "a").close()
-
- write_shell = False
- if compat.platform != "Darwin":
- with opened_w_error(CONST_shell_config, "r") as shell_config:
- if shell_config is not None:
- if source_string not in shell_config.read():
- write_shell = True
-
- # On Darwin: Append to shell config only if shell_profile does not exist
- # On Linux: Append to shell config anyway
- if write_shell and compat.platform != "Darwin":
- with opened_w_error(CONST_shell_config, "a") as shell_config:
- if shell_config is not None:
- shell_config.write(source_string)
- write_shell = False
-
- if exists(CONST_shell_profile):
- with opened_w_error(CONST_shell_profile, "r") as shell_profile:
- if shell_profile is not None:
- if source_string not in shell_profile.read():
- write_shell = True
- if write_shell:
- with opened_w_error(CONST_shell_profile, "a") as shell_profile:
- if shell_profile is not None:
- shell_profile.write(source_string)
- write_shell = False
- else:
- logging.error("Unknown shell found")
- return -1
-
- print("shell configuration updated")
- return 0
-
-
-def fix_gnu_sparse(args):
- # Fix GNUSparseFile.0 folder in macOS if exists
- global CONST_lib_ext, CONST_lib_dir
-
- for dir in listdir(args.path):
- if not isdir(join(args.path, dir)):
- continue
- if "GNUSparseFile" in dir:
- for file in listdir(join(args.path, dir)):
- if file.endswith(CONST_lib_ext):
- if isdir(join(args.path, CONST_lib_dir)):
- shutil.move(
- join(args.path, dir, file), join(args.path, CONST_lib_dir)
- )
- else:
- logging.error(
- "%s directory not found", join(args.path, CONST_lib_dir)
- )
- try:
- mkdir(join(args.path, CONST_lib_dir))
- shutil.move(
- join(args.path, dir, file),
- join(args.path, CONST_lib_dir),
- )
- except:
- pass
- elif (
- file.endswith(".h")
- or file.endswith(".hpp")
- or file.endswith(".inc")
- ):
- shutil.move(join(args.path, dir, file), join(args.path, "include"))
- else:
- shutil.move(join(args.path, dir, file), join(args.path, "bin"))
- for sub_dir in listdir(join(args.path, dir)):
- if not isdir(join(args.path, dir, sub_dir)):
- continue
- if "GNUSparseFile" in sub_dir:
- for file in listdir(join(args.path, dir, sub_dir)):
- shutil.move(
- join(args.path, dir, sub_dir, file), join(args.path, dir)
- )
- if len(listdir(join(args.path, dir, sub_dir))) == 0:
- shutil.rmtree(join(args.path, dir, sub_dir))
-
-
-def ldconfig(args, compat):
- if geteuid() == 0:
- # Only run ldconfig or update_dyld_shared_cache when user is root/sudoer
- if compat.platform == "Linux":
- cmd = "ldconfig {0}".format(join(args.path, CONST_lib_dir))
- output = run_shell_command(cmd)
- logging.debug("%s: %s", cmd, output)
- elif compat.platform == "Darwin":
- cmd = "update_dyld_shared_cache {0}".format(join(args.path, CONST_lib_dir))
- output = run_shell_command(cmd)
- logging.debug("%s: %s", cmd, output)
- else:
- logging.warning("Help adding ldconfig for your platform")
- else:
- logging.debug("Not root or sudoer, skip ldconfig")
-
-
-def is_default_path(args):
- global PATH
- return args.path == abspath(PATH) or args.path[:4] != "/usr"
-
-
-def install_image_extension(args, compat):
- global CONST_release_pkg, CONST_lib_dir
-
- if not get_remote_version_availability(
- "second-state/WasmEdge-image", args.image_version
- ):
- logging.error(
- "Image extension version incorrect: {0}".format(args.image_version)
- )
- return -1
- if compat.prefix() + IMAGE not in SUPPORTED_EXTENSIONS_VERSION:
- logging.error("Image extensions not compatible: {0}".format(compat.prefix()))
- return -1
- elif (
- SUPPORTED_EXTENSIONS_VERSION[compat.prefix() + IMAGE].compare(
- args.image_version
- )
- > 0
- ):
- logging.error(
- "Min image extensions version: {0}".format(
- SUPPORTED_EXTENSIONS_VERSION[compat.prefix() + IMAGE],
- )
- )
- return -1
-
- print("Downloading image extension")
-
- local_release_package = CONST_release_pkg
-
- # From WasmEdge 0.11.1, we have the Ubuntu release.
- # Installation of ubuntu version extensions when the ubuntu version of WasmEdge selected.
- if VersionString(args.image_version).compare("0.11.1") >= 0:
- local_release_package = compat.release_package_wasmedge
- logging.debug("Downloading dist package: {0}".format(local_release_package))
-
- image_pkg = "WasmEdge-image-" + args.image_version + "-" + local_release_package
-
- download_url(CONST_urls[IMAGE], join(TEMP_PATH, image_pkg), show_progress)
-
- # Extract archive
- extract_archive(
- join(TEMP_PATH, image_pkg),
- args.path,
- join(TEMP_PATH, "WasmEdge-image"),
- env_file_path=CONST_env_path,
- remove_finished=True,
- )
-
- wasmedge_image_temp = join(TEMP_PATH, "WasmEdge-image")
- for dir in listdir(wasmedge_image_temp):
- wasmedge_image_temp_dir = join(wasmedge_image_temp, dir)
- for file in listdir(wasmedge_image_temp_dir):
- if isdir(join(wasmedge_image_temp_dir, file)) and "wasmedge" == file:
- copytree(
- join(wasmedge_image_temp_dir, file),
- join(args.path, "include", "wasmedge"),
- )
- elif CONST_lib_ext in file:
- if isdir(join(args.path, CONST_lib_dir)):
- shutil.move(
- join(wasmedge_image_temp_dir, file),
- join(args.path, CONST_lib_dir, file),
- )
- else:
- logging.error(
- "%s directory not found", join(args.path, CONST_lib_dir)
- )
- try:
- mkdir(join(args.path, CONST_lib_dir))
- shutil.move(
- join(wasmedge_image_temp_dir, file),
- join(args.path, "lib", file),
- )
- except:
- pass
- elif isdir(join(wasmedge_image_temp_dir, file)):
- copytree(
- join(wasmedge_image_temp_dir, file),
- join(args.path, file),
- )
- else:
- shutil.move(
- join(wasmedge_image_temp_dir, file),
- join(args.path, "bin", file),
- )
-
- fix_gnu_sparse(args)
-
- return 0
-
-
-def install_tensorflow_extension(args, compat):
- global CONST_release_pkg, CONST_lib_ext, CONST_lib_dir, CONST_env_path
-
- if not get_remote_version_availability(
- "second-state/WasmEdge-tensorflow", args.tf_version
- ):
- logging.error(
- "Tensorflow extension version incorrect: {0}".format(args.tf_version)
- )
- return -1
- elif not get_remote_version_availability(
- "second-state/WasmEdge-tensorflow-deps", args.tf_deps_version
- ):
- logging.error(
- "Tensorflow Deps extension version incorrect: {0}".format(
- args.tf_deps_version
- )
- )
- return -1
- elif not get_remote_version_availability(
- "second-state/WasmEdge-tensorflow", args.tf_tools_version
- ):
- logging.error(
- "Tensorflow Tools version incorrect: {0}".format(args.tf_tools_version)
- )
- return -1
-
- if compat.prefix() + TENSORFLOW not in SUPPORTED_EXTENSIONS_VERSION:
- logging.error(
- "Tensorflow extensions not compatible: {0}".format(compat.prefix())
- )
- return -1
- elif (
- SUPPORTED_EXTENSIONS_VERSION[compat.prefix() + TENSORFLOW].compare(
- args.tf_version
- )
- > 0
- ):
- logging.error(
- "Min tensorflow extensions version: {0}".format(
- SUPPORTED_EXTENSIONS_VERSION[compat.prefix() + TENSORFLOW],
- )
- )
- return -1
-
- download_tf = True
- download_tf_lite = True
-
- if compat.machine == "aarch64":
- download_tf = False
-
- local_release_package = CONST_release_pkg
-
- # From WasmEdge 0.11.1, we have the Ubuntu release.
- # Installation of ubuntu version extensions when the ubuntu version of WasmEdge selected.
- if VersionString(args.tf_version).compare("0.11.1") >= 0:
- local_release_package = compat.release_package_wasmedge
- logging.debug("Downloading dist package: {0}".format(local_release_package))
-
- if download_tf:
- tf_pkg = "WasmEdge-tensorflow-" + args.tf_version + "-" + local_release_package
- tf_deps_pkg = (
- "WasmEdge-tensorflow-deps-TF-"
- + args.tf_deps_version
- + "-"
- + CONST_release_pkg
- )
-
- print("Downloading tensorflow extension")
- download_url(CONST_urls[TENSORFLOW], join(TEMP_PATH, tf_pkg), show_progress)
-
- print("Downloading tensorflow-deps")
- download_url(
- CONST_urls[TENSORFLOW_DEPS], join(TEMP_PATH, tf_deps_pkg), show_progress
- )
-
- # Extract archive
- extract_archive(
- join(TEMP_PATH, tf_pkg),
- args.path,
- join(TEMP_PATH, "WasmEdge-tensorflow"),
- env_file_path=CONST_env_path,
- remove_finished=True,
- )
-
- # Extract archive
- extract_archive(
- join(TEMP_PATH, tf_deps_pkg),
- join(args.path, CONST_lib_dir),
- join(TEMP_PATH, "WasmEdge-tensorflow-deps", CONST_lib_dir),
- env_file_path=CONST_env_path,
- remove_finished=True,
- )
-
- copytree(join(TEMP_PATH, "WasmEdge-tensorflow"), args.path)
- copytree(join(TEMP_PATH, "WasmEdge-tensorflow-deps"), args.path)
-
- if download_tf_lite:
- tf_lite_pkg = (
- "WasmEdge-tensorflowlite-" + args.tf_version + "-" + local_release_package
- )
- tf_deps_lite_pkg = (
- "WasmEdge-tensorflow-deps-TFLite-"
- + args.tf_deps_version
- + "-"
- + CONST_release_pkg
- )
-
- print("Downloading tensorflow-lite extension")
- download_url(
- CONST_urls[TENSORFLOW_LITE], join(TEMP_PATH, tf_lite_pkg), show_progress
- )
-
- print("Downloading tensorflow-lite-deps")
- download_url(
- CONST_urls[TENSORFLOW_LITE_DEPS],
- join(TEMP_PATH, tf_deps_lite_pkg),
- show_progress,
- )
-
- # Extract archive
- extract_archive(
- join(TEMP_PATH, tf_lite_pkg),
- args.path,
- join(TEMP_PATH, "WasmEdge-tensorflow-lite"),
- env_file_path=CONST_env_path,
- remove_finished=True,
- )
-
- # Extract archive
- extract_archive(
- join(TEMP_PATH, tf_deps_lite_pkg),
- join(args.path, CONST_lib_dir),
- join(TEMP_PATH, "WasmEdge-tensorflow-lite-deps", CONST_lib_dir),
- env_file_path=CONST_env_path,
- remove_finished=True,
- )
-
- copytree(join(TEMP_PATH, "WasmEdge-tensorflow-lite"), args.path)
- copytree(join(TEMP_PATH, "WasmEdge-tensorflow-lite-deps"), args.path)
-
- tf_tools_pkg = (
- "WasmEdge-tensorflow-tools-" + args.tf_tools_version + "-" + CONST_release_pkg
- )
-
- print("Downloading tensorflow-tools extension")
- download_url(
- CONST_urls[TENSORFLOW_TOOLS], join(TEMP_PATH, tf_tools_pkg), show_progress
- )
-
- # Extract archive
- extract_archive(
- join(TEMP_PATH, tf_tools_pkg),
- join(args.path, "bin"),
- join(TEMP_PATH, "WasmEdge-tensorflow-tools", "bin"),
- env_file_path=CONST_env_path,
- remove_finished=True,
- )
-
- copytree(join(TEMP_PATH, "WasmEdge-tensorflow-tools"), args.path)
-
- fix_gnu_sparse(args)
-
- all_files = run_shell_command("ls -R {0}".format(TEMP_PATH))
-
- if not isdir(join(args.path, CONST_lib_dir)):
- logging.error("Strange: No %s directory found", CONST_lib_dir)
-
- for file in listdir(join(args.path, CONST_lib_dir)):
- if CONST_lib_ext not in file:
- # ignore files that are not libraries
- continue
- if file not in all_files:
- # ignore files that are not downloaded by this script
- continue
- if "tensorflow" not in file:
- continue
- # check if it contains any digits
- if not any(i.isdigit() for i in file):
- continue
- if compat.platform == "Linux":
- name, version = file.split(CONST_lib_ext, 1)
- if version[0] == ".":
- version = version[1:]
- if version != "" and version.count(".") >= 2:
- no_v_name = name + CONST_lib_ext
- single_v_name = name + CONST_lib_ext + "." + version.split(".")[0]
- dual_v_name = (
- name
- + CONST_lib_ext
- + "."
- + version.split(".")[0]
- + "."
- + version.split(".")[1]
- )
- file_path = join(args.path, CONST_lib_dir, file)
- single_v_file_path = join(args.path, CONST_lib_dir, single_v_name)
- dual_v_file_path = join(args.path, CONST_lib_dir, dual_v_name)
- no_v_file_path = join(args.path, CONST_lib_dir, no_v_name)
- try:
- symlink(file_path, single_v_file_path)
- symlink(file_path, dual_v_file_path)
- symlink(file_path, no_v_file_path)
- except Exception as e:
- logging.debug(e)
- else:
- continue
- elif compat.platform == "Darwin":
- name, version = file.split(CONST_lib_ext, 1)[0].split(".", 1)
- if version != "" and version.count(".") >= 2:
- no_v_name = name + CONST_lib_ext
- single_v_name = name + "." + version.split(".")[0] + CONST_lib_ext
- dual_v_name = (
- name
- + "."
- + version.split(".")[0]
- + "."
- + version.split(".")[1]
- + CONST_lib_ext
- )
- file_path = join(args.path, CONST_lib_dir, file)
- single_v_file_path = join(args.path, CONST_lib_dir, single_v_name)
- dual_v_file_path = join(args.path, CONST_lib_dir, dual_v_name)
- no_v_file_path = join(args.path, CONST_lib_dir, no_v_name)
- try:
- symlink(file_path, single_v_file_path)
- symlink(file_path, dual_v_file_path)
- symlink(file_path, no_v_file_path)
- except Exception as e:
- logging.debug(e)
- else:
- continue
- else:
- reraise(Exception("Not implemented for {0}".format(compat.platform)))
- with opened_w_error(CONST_env_path, "a") as env_file:
- if env_file is not None:
- env_file.write("#" + single_v_file_path + "\n")
- logging.debug("Appending:%s", single_v_file_path)
- env_file.write("#" + dual_v_file_path + "\n")
- logging.debug("Appending:%s", dual_v_file_path)
- env_file.write("#" + no_v_file_path + "\n")
- logging.debug("Appending:%s", no_v_file_path)
- else:
- logging.error("Not able to append installed files to env file")
-
- for main_dir in ["WasmEdge-tensorflow", "WasmEdge-tensorflow-lite"]:
- if not isdir(join(TEMP_PATH, main_dir)):
- continue
- for directory_file in listdir(join(TEMP_PATH, main_dir)):
- if isdir(directory_file):
- wasmedge_tf_folder = join(TEMP_PATH, main_dir, directory_file)
- for _file in listdir(wasmedge_tf_folder):
- if (
- _file == "wasmedge"
- and isdir(join(wasmedge_tf_folder, _file))
- and is_default_path(args)
- ):
- copytree(
- join(wasmedge_tf_folder, _file),
- join(args.path, "include", "wasmedge"),
- )
- elif CONST_lib_ext in _file:
- if isdir(join(args.path, CONST_lib_dir)):
- shutil.move(
- join(wasmedge_tf_folder, _file),
- join(args.path, CONST_lib_dir, _file),
- )
- else:
- logging.error(
- "%s is not a directory", join(args.path, CONST_lib_dir)
- )
- try:
- mkdir(join(args.path, CONST_lib_dir))
- shutil.move(
- join(wasmedge_tf_folder, _file),
- join(args.path, CONST_lib_dir, _file),
- )
- except:
- pass
-
- elif isdir(join(wasmedge_tf_folder, _file)):
- copytree(
- join(wasmedge_tf_folder, _file),
- join(args.path, _file),
- )
- else:
- shutil.move(
- join(wasmedge_tf_folder, _file),
- join(args.path, "bin", _file),
- )
-
- if download_tf:
- # Check if wasmedge binary works
- wasmedge_tf_output = run_shell_command(
- ". {0}/env &&{0}/bin/wasmedge-tensorflow --version".format(args.path)
- )
-
- if args.tf_version in wasmedge_tf_output:
- print("WasmEdge Successfully installed")
- else:
- logging.critical(
- "WasmEdge Tensorflow installation incorrect: {0}".format(
- wasmedge_tf_output
- )
- )
-
- if download_tf_lite:
- # Check if wasmedge binary works
- wasmedge_tf_lite_output = run_shell_command(
- ". {0}/env && {0}/bin/wasmedge-tensorflow-lite --version".format(args.path)
- )
-
- if args.tf_version in wasmedge_tf_lite_output:
- print("WasmEdge Tensorflow Lite Successfully installed")
- else:
- logging.critical(
- "WasmEdge Tensorflow installation incorrect: {0}".format(
- wasmedge_tf_lite_output
- )
- )
-
- return 0
-
-
-def install_plugins(args, compat):
- global CONST_lib_dir
- url_root = "https://github.com/WasmEdge/WasmEdge/releases/download/"
- url_root += "$VERSION$/WasmEdge-plugin-$PLUGIN_NAME$-$VERSION$-$DIST$_$ARCH$.tar.gz"
-
- if len(args.plugins) >= 1:
- for plugin_name in args.plugins:
- plugin_version_supplied = None
- if plugin_name.find(":") != -1:
- plugin_name, plugin_version_supplied = plugin_name.split(":")
-
- if plugin_name not in PLUGINS_AVAILABLE:
- logging.error(
- "%s plugin not found, available names - %s",
- plugin_name,
- PLUGINS_AVAILABLE,
- )
- continue
-
- if compat.dist + compat.machine + plugin_name not in SUPPORTTED_PLUGINS:
- logging.error(
- "Plugin not compatible: %s",
- compat.dist + compat.machine + plugin_name,
- )
- logging.debug("Supported: %s", SUPPORTTED_PLUGINS)
- continue
- else:
- if plugin_version_supplied is None:
- plugin_version_supplied = args.version
- elif (
- SUPPORTTED_PLUGINS[
- compat.dist + compat.machine + plugin_name
- ].compare(plugin_version_supplied)
- > 0
- ):
- logging.error(
- "Plugin not compatible: %s %s",
- plugin_name,
- plugin_version_supplied,
- )
- continue
-
- plugin_url = (
- url_root.replace("$PLUGIN_NAME$", plugin_name)
- .replace("$VERSION$", plugin_version_supplied)
- .replace("$DIST$", compat.dist)
- .replace("$ARCH$", compat.machine)
- )
- logging.debug("Plugin URL: %s", plugin_url)
-
- print("Downloading Plugin: " + plugin_name)
- download_url(
- plugin_url,
- join(TEMP_PATH, "Plugin" + plugin_name) + ".tar.gz",
- show_progress,
- )
- extract_archive(
- join(TEMP_PATH, "Plugin" + plugin_name + ".tar.gz"),
- join(args.path),
- join(TEMP_PATH, "Plugins"),
- env_file_path=CONST_env_path,
- remove_finished=True,
- )
-
- if isdir(join(TEMP_PATH, "Plugins")):
- if is_default_path(args):
- copytree(join(TEMP_PATH, "Plugins"), join(args.path, "plugin"))
- else:
- copytree(
- join(TEMP_PATH, "Plugins"),
- join(args.path, CONST_lib_dir, "wasmedge"),
- )
-
-
-def set_consts(args, compat):
- global CONST_release_pkg, CONST_ipkg, CONST_lib_ext, CONST_urls, CONST_lib_dir, CONST_env_path
- CONST_release_pkg = compat.release_package
- CONST_ipkg = compat.install_package_name
- CONST_lib_ext = compat.lib_extension
-
- local_release_package_tf = CONST_release_pkg
-
- # From WasmEdge 0.11.1, we have the Ubuntu release.
- # Installation of ubuntu version extensions when the ubuntu version of WasmEdge selected.
- if VersionString(args.tf_version).compare("0.11.1") >= 0:
- local_release_package_tf = compat.release_package_wasmedge
- logging.debug("Tensorflow release pkg: {0}".format(local_release_package_tf))
-
- local_release_package_im = CONST_release_pkg
-
- # From WasmEdge 0.11.1, we have the Ubuntu release.
- # Installation of ubuntu version extensions when the ubuntu version of WasmEdge selected.
- if VersionString(args.image_version).compare("0.11.1") >= 0:
- local_release_package_im = compat.release_package_wasmedge
- logging.debug("Image release pkg: {0}".format(local_release_package_im))
-
- CONST_urls = {
- WASMEDGE: "https://github.com/WasmEdge/WasmEdge/releases/download/{0}/WasmEdge-{0}-{1}".format(
- args.version, compat.release_package_wasmedge
- ),
- WASMEDGE_UNINSTALLER: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/{0}/utils/uninstall.sh".format(
- args.uninstall_script_tag
- ),
- IMAGE: "https://github.com/second-state/WasmEdge-image/releases/download/{0}/WasmEdge-image-{0}-{1}".format(
- args.image_version, local_release_package_im
- ),
- TENSORFLOW_DEPS: "https://github.com/second-state/WasmEdge-tensorflow-deps/releases/download/{0}/WasmEdge-tensorflow-deps-TF-{0}-{1}".format(
- args.tf_deps_version, CONST_release_pkg
- ),
- TENSORFLOW_LITE_DEPS: "https://github.com/second-state/WasmEdge-tensorflow-deps/releases/download/{0}/WasmEdge-tensorflow-deps-TFLite-{0}-{1}".format(
- args.tf_deps_version, CONST_release_pkg
- ),
- TENSORFLOW: "https://github.com/second-state/WasmEdge-tensorflow/releases/download/{0}/WasmEdge-tensorflow-{0}-{1}".format(
- args.tf_version, local_release_package_tf
- ),
- TENSORFLOW_LITE: "https://github.com/second-state/WasmEdge-tensorflow/releases/download/{0}/WasmEdge-tensorflowlite-{0}-{1}".format(
- args.tf_version, local_release_package_tf
- ),
- TENSORFLOW_TOOLS: "https://github.com/second-state/WasmEdge-tensorflow-tools/releases/download/{0}/WasmEdge-tensorflow-tools-{0}-{1}".format(
- args.tf_tools_version, CONST_release_pkg
- ),
- }
-
-
-def run_shell_command(cmd):
- try:
- output = subprocess.check_output([cmd], shell=True)
- return output.decode("utf8").strip()
- except subprocess.CalledProcessError as e:
- if "Cannot detect installation path" in str(e.output):
- logging.warning("Uninstaller did not find previous installation")
- else:
- print("Exception on process, rc=", e.returncode, "output=", e.output, e.cmd)
-
- return ""
-
-
-def get_latest_github_release(repo):
- return run_shell_command(
- """git ls-remote --refs --tags "https://github.com/{0}.git" |
- cut -d '/' -f 3 |
- awk {1} | sort --version-sort | sed 's/_$//' |
- grep -e '^[0-9]\+.[0-9]\+.[0-9]\+$' |
- tail -1""".format(
- repo,
- "'{ if ($1 ~ /-/) print; else print $0\"_\" ;}'",
- )
- )
-
-
-def get_remote_version_availability(repo, version):
- output = run_shell_command(
- """git ls-remote --refs --tags "https://github.com/{0}.git" |
- cut -d '/' -f 3 |
- awk {1} | sort --version-sort | sed 's/_$//'""".format(
- repo,
- "'{ if ($1 ~ /-/) print; else print $0\"_\" ;}'",
- )
- )
- if version in output:
- return True
- return False
-
-
-class Compat:
- def __init__(
- self,
- platform_=platform.system(),
- machine=platform.machine(),
- dist_=None,
- version=None,
- extensions=None,
- ):
- self.platform = platform_ # Linux, Darwin
- self.machine = machine # x86_64, arm
- self.version = VersionString(version)
- self.extensions = extensions
- self.release_package = None
- self.install_package_name = None
- self.lib_extension = None
- self.ld_library_path = None
- self.dist = dist_
- self.release_package_wasmedge = None
-
- if self.platform == "Linux":
- self.install_package_name = "WasmEdge-{0}-Linux".format(self.version)
- self.lib_extension = ".so"
- self.ld_library_path = "LD_LIBRARY_PATH"
-
- if self.machine in ["arm64", "armv8", "aarch64"]:
- self.release_package = "manylinux2014_aarch64.tar.gz"
- elif self.machine in ["x86_64", "amd64"]:
- self.release_package = "manylinux2014_x86_64.tar.gz"
- else:
- reraise(Exception("Unsupported arch: {0}".format(self.machine)))
-
- self.release_package_wasmedge = self.release_package
-
- if self.dist is None:
- if sys.version_info[0] == 2:
- if (
- "Ubuntu" in platform.dist() and "20.04" in platform.dist()
- ) or "Ubuntu 20.04" in run_shell_command(
- "lsb_release -d | awk -F'\t' '{print $2}'"
- ):
- self.dist = "ubuntu20.04"
- else:
- self.dist = "manylinux2014"
- elif sys.version_info[0] == 3:
- __lsb_rel = run_shell_command(
- "cat /etc/lsb-release | grep RELEASE"
- )[-5:]
- if "20.04" == __lsb_rel or "Ubuntu 20.04" in run_shell_command(
- "lsb_release -d | awk -F'\t' '{print $2}'"
- ):
- self.dist = "ubuntu20.04"
- else:
- self.dist = "manylinux2014"
-
- # Below version 0.11.1 different distributions for wasmedge binary do not exist
- if self.version.compare("0.11.1") != -1:
- if self.machine in ["arm64", "armv8", "aarch64"]:
- self.release_package_wasmedge = self.dist + "_aarch64.tar.gz"
- elif self.machine in ["x86_64", "amd64"]:
- self.release_package_wasmedge = self.dist + "_x86_64.tar.gz"
- else:
- reraise(Exception("Unsupported arch: {0}".format(self.machine)))
-
- elif self.platform == "Darwin":
- self.ld_library_path = "DYLD_LIBRARY_PATH"
- self.install_package_name = "WasmEdge-{0}-Darwin".format(self.version)
- self.release_package = "darwin_{0}.tar.gz".format(self.machine)
- self.release_package_wasmedge = self.release_package
- self.lib_extension = ".dylib"
- if self.dist is None:
- self.dist = "darwin"
-
- def __str__(self):
- return (
- "Platform:{0}\nMachine:{1}\nVersion:{2}\nExtensions:{3}\nDist:{4}\n".format(
- self.platform, self.machine, self.version, self.extensions, self.dist
- )
- )
-
- if sys.version_info[0] == 2:
-
- def __nonzero__(self):
- return self.bool_overload()
-
- elif sys.version_info[0] == 3:
-
- def __bool__(self):
- return self.bool_overload()
-
- def bool_overload(self):
- if self.platform not in SUPPORTED_PLATFORM_MACHINE:
- reraise(Exception("Unsupported platform: {0}".format(self.platform)))
- if self.machine not in SUPPORTED_PLATFORM_MACHINE[self.platform]:
- reraise(Exception("Unsupported machine: {0}".format(self.machine)))
- if self.extensions is not None and len(self.extensions) > 0:
- if not (
- set(self.extensions)
- <= set(SUPPORTED_EXTENSIONS[self.platform + self.machine])
- ):
- reraise(
- Exception(
- "Extensions not supported: {0}. Supported extensions: {1}".format(
- self.extensions,
- SUPPORTED_EXTENSIONS[self.platform + self.machine],
- )
- )
- )
- if (
- self.version.compare(
- version2=SUPPORTED_MIN_VERSION[self.platform + self.machine].version
- )
- < 0
- ):
- reraise(
- Exception(
- "Version not supported. Min Version: {0}".format(
- SUPPORTED_MIN_VERSION[self.platform + self.machine].version
- )
- )
- )
-
- if not get_remote_version_availability(
- "WasmEdge/WasmEdge", self.version.version
- ):
- reraise(
- Exception(
- "Version {0} does not exist in remote repository of WasmEdge".format(
- self.version.version
- )
- )
- )
- return True
-
- def prefix(self):
- return self.platform + self.machine
-
-
-def main(args):
- global CONST_env_path, CONST_release_pkg, CONST_ipkg, CONST_shell_config, CONST_shell_profile, CONST_lib_dir
-
- compat = Compat(
- version=args.version,
- extensions=args.extensions,
- platform_=args.platform,
- machine=args.machine,
- dist_=args.dist,
- )
-
- logging.debug("Compat object: %s", compat)
- logging.debug("Temp path: %s", TEMP_PATH)
- logging.debug("CLI Args:")
- logging.debug(args)
-
- if len(args.plugins) >= 1:
- logging.warning("Experimental Option Selected: plugins")
- logging.warning("plugins option may change later")
-
- if compat:
- print("Compatible with current configuration")
-
- set_consts(args, compat)
-
- # Run uninstaller
- uninstaller_path = join(TEMP_PATH, "uninstall.sh")
- download_url(CONST_urls[WASMEDGE_UNINSTALLER], uninstaller_path)
-
- print("Running Uninstaller")
-
- logging.debug(
- run_shell_command("bash {0} -p {1} -q".format(uninstaller_path, args.path))
- )
- remove(uninstaller_path)
-
- # If args.path is default then remove it initially
- if PATH in args.path and exists(args.path):
- shutil.rmtree(args.path)
-
- set_env(args, compat)
-
- logging.debug("CONST_env_path: %s", CONST_env_path)
- logging.debug("CONST_release_pkg: %s", CONST_release_pkg)
- logging.debug("CONST_ipkg: %s", CONST_ipkg)
- logging.debug("CONST_lib_ext: %s", CONST_lib_ext)
- logging.debug("CONST_urls: %s", CONST_urls)
- logging.debug("CONST_lib_dir: %s", CONST_lib_dir)
-
- if getenv("SHELL") != SHELL:
- logging.warning("SHELL variable not found. Using %s as SHELL", SHELL)
-
- if shell_configure(args, compat) != 0:
- logging.error("Error in configuring shell")
-
- logging.debug("CONST_shell_profile: %s", CONST_shell_profile)
- logging.debug("CONST_shell_config: %s", CONST_shell_config)
-
- print("Downloading WasmEdge")
-
- # Download WasmEdge
- download_url(
- CONST_urls[WASMEDGE], join(TEMP_PATH, CONST_release_pkg), show_progress
- )
-
- # Extract archive
- extract_archive(
- join(TEMP_PATH, CONST_release_pkg),
- args.path,
- join(TEMP_PATH),
- env_file_path=CONST_env_path,
- remove_finished=True,
- )
-
- print("Installing WasmEdge")
- # Copy the tree
- for sub_dir in listdir(join(TEMP_PATH, CONST_ipkg)):
- if sub_dir == "lib64":
- copytree(join(TEMP_PATH, CONST_ipkg, sub_dir), join(args.path, "lib"))
- else:
- copytree(join(TEMP_PATH, CONST_ipkg, sub_dir), join(args.path, sub_dir))
-
- if is_default_path(args):
- # perform actions if default path
- for dir in listdir(args.path):
- path = join(args.path, dir)
- if not isdir(path):
- continue
- for subdir in listdir(path):
- sub_folder = join(path, subdir)
- if isdir(sub_folder):
- if any("Plugin" in s for s in listdir(sub_folder)):
- # Handle plugins
- copytree(sub_folder, join(args.path, "plugin"), True)
- shutil.rmtree(sub_folder)
-
- # Check if wasmedge binary works
- wasmedge_output = run_shell_command(
- ". {0}/env && {0}/bin/wasmedge --version".format(args.path)
- )
-
- if args.version in wasmedge_output:
- print("WasmEdge Successfully installed")
- else:
- logging.critical(
- "WasmEdge installation incorrect: {0}".format(wasmedge_output)
- )
-
- if IMAGE in args.extensions or "all" in args.extensions:
- if install_image_extension(args, compat) != 0:
- logging.error("Error in installing image extensions")
- else:
- print("Image extension installed")
-
- if TENSORFLOW in args.extensions or "all" in args.extensions:
- if install_tensorflow_extension(args, compat) != 0:
- logging.error("Error in installing tensorflow extensions")
- else:
- print("Tensorflow extension installed")
-
- install_plugins(args, compat)
-
- ldconfig(args, compat)
-
- # Cleanup
- shutil.rmtree(TEMP_PATH)
-
- if compat.platform != "Darwin":
- print("Run:\nsource {0}".format(CONST_shell_config))
- else:
- print("Run:\nsource {0}".format(CONST_shell_profile))
- else:
- reraise(Exception("Incompatible with your machine\n{0}".format(compat)))
-
-
-if __name__ == "__main__":
- parser = argparse.ArgumentParser(
- description="WasmEdge installation, uninstallation and extensions install"
- )
- parser.add_argument(
- "-e",
- "--extension",
- dest="extensions",
- choices=EXTENSIONS.append("all"),
- required=False,
- default=[],
- nargs="*",
- help="Supported Extensions - {0}".format(EXTENSIONS),
- )
- parser.add_argument(
- "-v",
- "--version",
- dest="version",
- default=get_latest_github_release("WasmEdge/WasmEdge"),
- required=False,
- help="Version for WasmEdge",
- )
- parser.add_argument(
- "-D",
- "--debug",
- dest="loglevel",
- required=False,
- action="store_const",
- const=logging.DEBUG,
- help="Verbosity debug",
- )
- parser.add_argument(
- "-p",
- "--path",
- dest="path",
- required=False,
- default=PATH,
- help="Installation path for WasmEdge",
- )
- parser.add_argument(
- "-r",
- "--remove-old",
- dest="remove_old",
- required=False,
- choices=["yes", "no"],
- help="Run uninstaller script before installing",
- )
- parser.add_argument(
- "-u",
- "--uninstall-script-tag",
- dest="uninstall_script_tag",
- required=False,
- default=get_latest_github_release("WasmEdge/WasmEdge"),
- help="GitHub tag for uninstall script",
- )
- parser.add_argument(
- "--plugins",
- dest="plugins",
- required=False,
- default=[],
- nargs="*",
- help="(experimental option)Supported Plugins. Example\n"
- + "--plugins wasi_crypto:0.11.0\n"
- + "--plugins wasi_crypto",
- )
- parser.add_argument(
- "--tf-version",
- dest="tf_version",
- required=False,
- default=None,
- help="Tensorflow and tensorflow lite version",
- )
- parser.add_argument(
- "--tf-deps-version",
- dest="tf_deps_version",
- required=False,
- default=None,
- help="Tensorflow and tensorflow lite deps version",
- )
- parser.add_argument(
- "--tf-tools-version",
- dest="tf_tools_version",
- required=False,
- default=None,
- help="Tensorflow and tensorflow lite tools version",
- )
- parser.add_argument(
- "--image-version",
- dest="image_version",
- required=False,
- default=None,
- help="Image extension version",
- )
- parser.add_argument(
- "--platform",
- "--os",
- dest="platform",
- required=False,
- default=platform.system(),
- choices=["Linux", "Darwin"],
- type=lambda s: s.title(),
- help="Platform ex- Linux, Darwin, Windows",
- )
- parser.add_argument(
- "--machine",
- "--arch",
- dest="machine",
- required=False,
- default=platform.machine(),
- choices=["x86_64", "aarch64", "arm", "arm64"],
- type=lambda s: s.lower(),
- help="Machine ex- x86_64, aarch64",
- )
- parser.add_argument(
- "--dist",
- dest="dist",
- required=False,
- default=None,
- choices=["ubuntu20.04", "manylinux2014"],
- type=lambda s: s.lower(),
- help="Dist ex- ubuntu20.04,manylinux2014",
- )
- args = parser.parse_args()
-
- logging.basicConfig(format="%(levelname)-8s- %(message)s", level=args.loglevel)
-
- args.path = abspath(args.path)
-
- if args.tf_version is None:
- args.tf_version = args.version
-
- if args.tf_deps_version is None:
- args.tf_deps_version = args.version
-
- if args.tf_tools_version is None:
- args.tf_tools_version = args.version
-
- if args.image_version is None:
- args.image_version = args.version
-
- logging.debug("Python Version: %s", sys.version_info)
- main(args)
diff --git a/env/wasip1-wasm-wasmer/Dockerfile b/env/wasip1-wasm-wasmer/Dockerfile
deleted file mode 100644
index fd3ba8c..0000000
--- a/env/wasip1-wasm-wasmer/Dockerfile
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright 2023 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-ARG REPO
-
-FROM debian:latest as builder
-LABEL maintainer="golang-dev@googlegroups.com"
-
-RUN apt-get update && apt-get -y install curl
-
-# A copy of https://raw.githubusercontent.com/wasmerio/wasmer-install/master/install.sh.
-COPY install.sh install.sh
-
-RUN bash install.sh v3.3.0
-
-FROM ${REPO}/linux-x86-sid:20221109
-
-COPY --from=builder /root/.wasmer/bin/wasmer /usr/local/bin/wasmer
-
-CMD ["/usr/local/bin/stage0"]
diff --git a/env/wasip1-wasm-wasmer/Makefile b/env/wasip1-wasm-wasmer/Makefile
deleted file mode 100644
index 386325c..0000000
--- a/env/wasip1-wasm-wasmer/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-# Copyright 2023 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-IMAGE_NAME=$(shell basename $(CURDIR))
-PROD_REPO=gcr.io/symbolic-datum-552
-
-usage:
- echo "Use prod or dev targets. For dev, specify your Docker repository with the REPO=foo argument." ; exit 1
-
-prod: Dockerfile
- docker build -t $(PROD_REPO)/$(IMAGE_NAME):latest --build-arg REPO=$(PROD_REPO) -f Dockerfile .
-
-pushprod: prod
- docker push $(PROD_REPO)/$(IMAGE_NAME):latest
-
-# You must provide a REPO=your-repo-name arg when you make
-# this target. REPO is the name of the Docker repository
-# that will be prefixed to the name of the image being built.
-dev: Dockerfile
- docker build -t $(REPO)/$(IMAGE_NAME):latest --build-arg REPO=$(REPO) -f Dockerfile .
- docker push $(REPO)/$(IMAGE_NAME):latest
diff --git a/env/wasip1-wasm-wasmer/install.sh b/env/wasip1-wasm-wasmer/install.sh
deleted file mode 100644
index e0b43dc..0000000
--- a/env/wasip1-wasm-wasmer/install.sh
+++ /dev/null
@@ -1,520 +0,0 @@
-#!/bin/sh
-
-# This install script is intended to download and install the latest available
-# release of Wasmer.
-# It attempts to identify the current platform and an error will be thrown if
-# the platform is not supported.
-#
-# Environment variables:
-# - WASMER_DIR (optional): defaults to $HOME/.wasmer
-#
-# You can install using this script:
-# $ curl https://raw.githubusercontent.com/wasmerio/wasmer-install/master/install.sh | sh
-
-# Installer script inspired by:
-# 1) https://raw.githubusercontent.com/golang/dep/master/install.sh
-# 2) https://sh.rustup.rs
-# 3) https://yarnpkg.com/install.sh
-# 4) https://raw.githubusercontent.com/brainsik/virtualenv-burrito/master/virtualenv-burrito.sh
-
-reset="\033[0m"
-red="\033[31m"
-green="\033[32m"
-yellow="\033[33m"
-white="\033[37m"
-bold="\e[1m"
-dim="\e[2m"
-
-RELEASES_URL="https://github.com/wasmerio/wasmer/releases"
-WAPM_RELEASES_URL="https://github.com/wasmerio/wapm-cli/releases"
-
-WASMER_VERBOSE="verbose"
-if [ -z "$WASMER_INSTALL_LOG" ]; then
- WASMER_INSTALL_LOG="$WASMER_VERBOSE"
-fi
-
-wasmer_download_json() {
- url="$2"
-
- # echo "Fetching $url.."
- if test -x "$(command -v curl)"; then
- response=$(curl -s -L -w 'HTTPSTATUS:%{http_code}' -H 'Accept: application/json' "$url")
- body=$(echo "$response" | sed -e 's/HTTPSTATUS\:.*//g')
- code=$(echo "$response" | tr -d '\n' | sed -e 's/.*HTTPSTATUS://')
- elif test -x "$(command -v wget)"; then
- temp=$(mktemp)
- body=$(wget -q --header='Accept: application/json' -O - --server-response "$url" 2>"$temp")
- code=$(awk '/^ HTTP/{print $2}' <"$temp" | tail -1)
- rm "$temp"
- else
- wasmer_error "Neither curl nor wget was available to perform http requests"
- return 1
- fi
- if [ "$code" != 200 ]; then
- wasmer_error "File download failed with code $code"
- return 1
- fi
-
- eval "$1='$body'"
- return 0
-}
-
-wasmer_download_file() {
- url="$1"
- destination="$2"
-
- # echo "Fetching $url.."
- if test -x "$(command -v curl)"; then
- if [ "$WASMER_INSTALL_LOG" = "$WASMER_VERBOSE" ]; then
- code=$(curl --progress-bar -w '%{http_code}' -L "$url" -o "$destination")
- printf "\033[K\n\033[1A"
- else
- code=$(curl -s -w '%{http_code}' -L "$url" -o "$destination")
- fi
- elif test -x "$(command -v wget)"; then
- if [ "$WASMER_INSTALL_LOG" = "$WASMER_VERBOSE" ]; then
- code=$(wget --show-progress --progress=bar:force:noscroll -q -O "$destination" --server-response "$url" 2>&1 | awk '/^ HTTP/{print $2}' | tail -1)
- printf "\033[K\n\033[1A"
- else
- code=$(wget --quiet -O "$destination" --server-response "$url" 2>&1 | awk '/^ HTTP/{print $2}' | tail -1)
- fi
- else
- wasmer_error "Neither curl nor wget was available to perform http requests."
- return 1
- fi
-
- if [ "$code" = 404 ]; then
- wasmer_error "Your platform is not yet supported ($OS-$ARCH).$reset\nPlease open an issue on the project if you would like to use wasmer in your project: https://github.com/wasmerio/wasmer"
- return 1
- elif [ "$code" != 200 ]; then
- wasmer_error "File download failed with code $code"
- return 1
- fi
- return 0
-}
-
-wasmer_detect_profile() {
- if [ -n "${PROFILE}" ] && [ -f "${PROFILE}" ]; then
- echo "${PROFILE}"
- return
- fi
-
- local DETECTED_PROFILE
- DETECTED_PROFILE=''
- local SHELLTYPE
- SHELLTYPE="$(basename "/$SHELL")"
-
- if [ "$SHELLTYPE" = "bash" ]; then
- if [ -f "$HOME/.bashrc" ]; then
- DETECTED_PROFILE="$HOME/.bashrc"
- elif [ -f "$HOME/.bash_profile" ]; then
- DETECTED_PROFILE="$HOME/.bash_profile"
- fi
- elif [ "$SHELLTYPE" = "zsh" ]; then
- DETECTED_PROFILE="$HOME/.zshrc"
- elif [ "$SHELLTYPE" = "fish" ]; then
- DETECTED_PROFILE="$HOME/.config/fish/config.fish"
- fi
-
- if [ -z "$DETECTED_PROFILE" ]; then
- if [ -f "$HOME/.profile" ]; then
- DETECTED_PROFILE="$HOME/.profile"
- elif [ -f "$HOME/.bashrc" ]; then
- DETECTED_PROFILE="$HOME/.bashrc"
- elif [ -f "$HOME/.bash_profile" ]; then
- DETECTED_PROFILE="$HOME/.bash_profile"
- elif [ -f "$HOME/.zshrc" ]; then
- DETECTED_PROFILE="$HOME/.zshrc"
- elif [ -f "$HOME/.config/fish/config.fish" ]; then
- DETECTED_PROFILE="$HOME/.config/fish/config.fish"
- fi
- fi
-
- if [ ! -z "$DETECTED_PROFILE" ]; then
- echo "$DETECTED_PROFILE"
- fi
-}
-
-wasmer_link() {
-
- WASMER_PROFILE="$(wasmer_detect_profile)"
-
- LOAD_STR="\n# Wasmer\nexport WASMER_DIR=\"$INSTALL_DIRECTORY\"\n[ -s \"\$WASMER_DIR/wasmer.sh\" ] && source \"\$WASMER_DIR/wasmer.sh\"\n"
- SOURCE_STR="# Wasmer config\nexport WASMER_DIR=\"$INSTALL_DIRECTORY\"\nexport WASMER_CACHE_DIR=\"\$WASMER_DIR/cache\"\nexport PATH=\"\$WASMER_DIR/bin:\$PATH:\$WASMER_DIR/globals/wapm_packages/.bin\"\n"
-
- # We create the wasmer.sh file
- printf "$SOURCE_STR" >"$INSTALL_DIRECTORY/wasmer.sh"
-
- if [ -z "${WASMER_PROFILE-}" ]; then
- wasmer_error "Profile not found. Tried:\n* ${WASMER_PROFILE} (as defined in \$PROFILE)\n* ~/.bashrc\n* ~/.bash_profile\n* ~/.zshrc\n* ~/.profile.\n${reset}Append the following lines to the correct file yourself:\n${SOURCE_STR}"
- return 1
- else
- printf "Updating bash profile $WASMER_PROFILE\n"
- if ! grep -q 'wasmer.sh' "$WASMER_PROFILE"; then
- # if [[ $WASMER_PROFILE = *"fish"* ]]; then
- # command fish -c 'set -U fish_user_paths $fish_user_paths ~/.wasmer/bin'
- # else
- command printf "$LOAD_STR" >>"$WASMER_PROFILE"
- # fi
- if [ "$WASMER_INSTALL_LOG" = "$WASMER_VERBOSE" ]; then
- printf "we've added the following to your $WASMER_PROFILE\n"
- echo "If you have a different profile please add the following:"
- printf "$dim$LOAD_STR$reset"
- fi
- wasmer_fresh_install=true
- else
- wasmer_warning "the profile already has Wasmer and has not been changed"
- fi
-
- version=$($INSTALL_DIRECTORY/bin/wasmer --version) || (
- wasmer_error "wasmer was installed, but doesn't seem to be working :("
- return 1
- )
-
- wasmer_install_status "check" "$version installed successfully ✓"
-
- if [ "$WASMER_INSTALL_LOG" = "$WASMER_VERBOSE" ]; then
- if [ "$wasmer_fresh_install" = true ]; then
- printf "wasmer & wapm will be available the next time you open the terminal.\n"
- printf "If you want to have the commands available now please execute:\n\nsource $INSTALL_DIRECTORY/wasmer.sh$reset\n"
- fi
- fi
- fi
- return 0
-}
-
-initArch() {
- ARCH=$(uname -m)
- case $ARCH in
- amd64) ARCH="amd64" ;;
- x86_64) ARCH="amd64" ;;
- aarch64) ARCH="aarch64" ;;
- riscv64) ARCH="riscv64" ;;
- arm64) ARCH="arm64" ;; # This is for the macOS M1 ARM chips
- *)
- wasmer_error "The system architecture (${ARCH}) is not yet supported by this installation script."
- exit 1
- ;;
- esac
- # echo "ARCH = $ARCH"
-}
-
-initOS() {
- OS=$(uname | tr '[:upper:]' '[:lower:]')
- case "$OS" in
- darwin) OS='darwin' ;;
- linux) OS='linux' ;;
- freebsd) OS='freebsd' ;;
- # mingw*) OS='windows';;
- # msys*) OS='windows';;
- *)
- printf "$red> The OS (${OS}) is not supported by this installation script.$reset\n"
- exit 1
- ;;
- esac
-}
-
-wasmer_install() {
- magenta1="${reset}\033[34;1m"
- magenta2=""
- magenta3=""
-
- if which wasmer >/dev/null; then
- printf "${reset}Welcome to the Wasmer bash installer!$reset\n"
- else
- printf "${reset}Welcome to the Wasmer bash installer!$reset\n"
- if [ "$WASMER_INSTALL_LOG" = "$WASMER_VERBOSE" ]; then
- printf "
-${magenta1} ww
-${magenta1} wwwww
-${magenta1} ww wwwwww w
-${magenta1} wwwww wwwwwwwww
-${magenta1}ww wwwwww w wwwwwww
-${magenta1}wwwww wwwwwwwwww wwwww
-${magenta1}wwwwww w wwwwwww wwwww
-${magenta1}wwwwwwwwwwwwww wwwww wwwww
-${magenta1}wwwwwwwwwwwwwww wwwww wwwww
-${magenta1}wwwwwwwwwwwwwww wwwww wwwww
-${magenta1}wwwwwwwwwwwwwww wwwww wwwww
-${magenta1}wwwwwwwwwwwwwww wwwww wwww
-${magenta1}wwwwwwwwwwwwwww wwwww
-${magenta1} wwwwwwwwwwww wwww
-${magenta1} wwwwwwww
-${magenta1} wwww
-${reset}
-"
- fi
- fi
-
- wasmer_download $1 && wasmer_link
- wapm_download
- wasmer_reset
-}
-
-wasmer_reset() {
- unset -f wasmer_install semver_compare wasmer_reset wasmer_download_json wasmer_link wasmer_detect_profile wasmer_download_file wasmer_download wasmer_verify_or_quit
-}
-
-version() {
- echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'
-}
-
-semverParseInto() {
- local RE='v?([0-9]+)[.]([0-9]+)[.]([0-9]+)([.0-9A-Za-z-]*)'
-
- # # strip word "v" if exists
- # version=$(echo "${1//v/}")
-
- #MAJOR
- eval $2=$(echo $1 | sed -E "s#$RE#\1#")
- #MINOR
- eval $3=$(echo $1 | sed -E "s#$RE#\2#")
- #MINOR
- eval $4=$(echo $1 | sed -E "s#$RE#\3#")
- #SPECIAL
- eval $5=$(echo $1 | sed -E "s#$RE#\4#")
-}
-
-###
-# Code inspired (copied partially and improved) with attributions from:
-# https://github.com/cloudflare/semver_bash/blob/master/semver.sh
-# https://gist.github.com/Ariel-Rodriguez/9e3c2163f4644d7a389759b224bfe7f3
-###
-semver_compare() {
- local version_a version_b
-
- local MAJOR_A=0
- local MINOR_A=0
- local PATCH_A=0
- local SPECIAL_A=0
-
- local MAJOR_B=0
- local MINOR_B=0
- local PATCH_B=0
- local SPECIAL_B=0
-
- semverParseInto $1 MAJOR_A MINOR_A PATCH_A SPECIAL_A
- semverParseInto $2 MAJOR_B MINOR_B PATCH_B SPECIAL_B
-
- # Check if our version is higher
- if [ $MAJOR_A -gt $MAJOR_B ]; then
- echo 1 && return 0
- fi
- if [ $MAJOR_A -eq $MAJOR_B ]; then
- if [ $MINOR_A -gt $MINOR_B ]; then
- echo 1 && return 0
- elif [ $MINOR_A -eq $MINOR_B ]; then
- if [ $PATCH_A -gt $PATCH_B ]; then
- echo 1 && return 0
- elif [ $PATCH_A -eq $PATCH_B ]; then
- if [ -n "$SPECIAL_A" ] && [ -z "$SPECIAL_B" ]; then
- # if the version we're targeting does not have a tag and our current
- # version does, we should upgrade because no tag > tag
- echo -1 && return 0
- elif [ "$SPECIAL_A" \> "$SPECIAL_B" ]; then
- echo 1 && return 0
- elif [ "$SPECIAL_A" = "$SPECIAL_B" ]; then
- # complete match
- echo 0 && return 0
- fi
- fi
- fi
- fi
-
- # if we're here we know that the target version cannot be less than or equal to
- # our current version, therefore we upgrade
-
- echo -1 && return 0
-}
-
-wasmer_download() {
- # identify platform based on uname output
- initArch || return 1
- initOS || return 1
-
- # assemble expected release artifact name
- BINARY="wasmer-${OS}-${ARCH}.tar.gz"
-
- # add .exe if on windows
- # if [ "$OS" = "windows" ]; then
- # BINARY="$BINARY.exe"
- # fi
-
- wasmer_install_status "downloading" "wasmer-$OS-$ARCH"
- if [ $# -eq 0 ]; then
- # The version was not provided, assume latest
- wasmer_download_json LATEST_RELEASE "$RELEASES_URL/latest" || return 1
- WASMER_RELEASE_TAG=$(echo "${LATEST_RELEASE}" | tr -s '\n' ' ' | sed 's/.*"tag_name":"//' | sed 's/".*//')
- printf "Latest release: ${WASMER_RELEASE_TAG}\n"
- else
- WASMER_RELEASE_TAG="${1}"
- printf "Installing provided version: ${WASMER_RELEASE_TAG}\n"
- fi
-
- if which $INSTALL_DIRECTORY/bin/wasmer >/dev/null; then
- WASMER_VERSION=$($INSTALL_DIRECTORY/bin/wasmer --version | sed 's/wasmer //g')
- printf "Wasmer already installed in ${INSTALL_DIRECTORY} with version: ${WASMER_VERSION}\n"
-
- WASMER_COMPARE=$(semver_compare $WASMER_VERSION $WASMER_RELEASE_TAG)
- case $WASMER_COMPARE in
- # WASMER_VERSION = WASMER_RELEASE_TAG
- 0)
- if [ $# -eq 0 ]; then
- wasmer_warning "wasmer is already installed in the latest version: ${WASMER_RELEASE_TAG}"
- else
- wasmer_warning "wasmer is already installed with the same version: ${WASMER_RELEASE_TAG}"
- fi
- printf "Do you want to force the installation?"
- wasmer_verify_or_quit || return 1
- ;;
- # WASMER_VERSION > WASMER_RELEASE_TAG
- 1)
- wasmer_warning "the selected version (${WASMER_RELEASE_TAG}) is lower than current installed version ($WASMER_VERSION)"
- printf "Do you want to continue installing Wasmer $WASMER_RELEASE_TAG?"
- wasmer_verify_or_quit || return 1
- ;;
- # WASMER_VERSION < WASMER_RELEASE_TAG (we continue)
- -1) ;;
- esac
- fi
-
- # fetch the real release data to make sure it exists before we attempt a download
- wasmer_download_json RELEASE_DATA "$RELEASES_URL/tag/$WASMER_RELEASE_TAG" || return 1
-
- BINARY_URL="$RELEASES_URL/download/$WASMER_RELEASE_TAG/$BINARY"
- DOWNLOAD_FILE=$(mktemp -t wasmer.XXXXXXXXXX)
-
- printf "Downloading archive from ${BINARY_URL}\n"
-
- wasmer_download_file "$BINARY_URL" "$DOWNLOAD_FILE" || return 1
- # echo -en "\b\b"
- printf "\033[K\n\033[1A"
-
- # windows not supported yet
- # if [ "$OS" = "windows" ]; then
- # INSTALL_NAME="$INSTALL_NAME.exe"
- # fi
-
- # echo "Moving executable to $INSTALL_DIRECTORY/$INSTALL_NAME"
-
- wasmer_install_status "installing" "${INSTALL_DIRECTORY}"
-
- mkdir -p $INSTALL_DIRECTORY
-
- # Untar the wasmer contents in the install directory
- tar -C $INSTALL_DIRECTORY -zxf $DOWNLOAD_FILE
- return 0
-}
-
-wapm_download() {
- # identify platform based on uname output
- initArch || return 1
- initOS || return 1
-
- if [ "$ARCH" = "arm64" ]; then
- ARCH="aarch64"
- fi
-
- # assemble expected release artifact name
- BINARY="wapm-cli-${OS}-${ARCH}.tar.gz"
-
- wasmer_install_status "downloading" "wapm-cli-$OS-$ARCH"
- # Download latest wapm version
- wasmer_download_json LATEST_RELEASE "$WAPM_RELEASES_URL/latest" || return 1
- WAPM_RELEASE_TAG=$(echo "${LATEST_RELEASE}" | tr -s '\n' ' ' | sed 's/.*"tag_name":"//' | sed 's/".*//' | sed 's/v//g')
- printf "Latest release: ${WAPM_RELEASE_TAG}\n"
-
- if which $INSTALL_DIRECTORY/bin/wapm >/dev/null; then
- WAPM_VERSION=$($INSTALL_DIRECTORY/bin/wapm --version | sed 's/wapm-cli //g')
- printf "WAPM already installed in ${INSTALL_DIRECTORY} with version: ${WAPM_VERSION}\n"
-
- WAPM_COMPARE=$(semver_compare $WAPM_VERSION $WAPM_RELEASE_TAG)
- case $WAPM_COMPARE in
- # WAPM_VERSION = WAPM_RELEASE_TAG
- 0)
- if [ $# -eq 0 ]; then
- wasmer_warning "WAPM is already installed in the latest version: ${WAPM_RELEASE_TAG}"
- else
- wasmer_warning "WAPM is already installed with the same version: ${WAPM_RELEASE_TAG}"
- fi
- printf "Do you want to force the installation?"
- wasmer_verify_or_quit || return 1
- ;;
- # WAPM_VERSION > WAPM_RELEASE_TAG
- 1)
- wasmer_warning "the selected version (${WAPM_RELEASE_TAG}) is lower than current installed version ($WAPM_VERSION)"
- printf "Do you want to continue installing WAPM $WAPM_RELEASE_TAG?"
- wasmer_verify_or_quit || return 1
- ;;
- # WAPM_VERSION < WAPM_RELEASE_TAG (we continue)
- -1) ;;
- esac
- fi
-
- # fetch the real release data to make sure it exists before we attempt a download
- wasmer_download_json RELEASE_DATA "$WAPM_RELEASES_URL/tag/v$WAPM_RELEASE_TAG" || return 1
-
- BINARY_URL="$WAPM_RELEASES_URL/download/v$WAPM_RELEASE_TAG/$BINARY"
- DOWNLOAD_FILE=$(mktemp -t wapm.XXXXXXXXXX)
-
- printf "Downloading archive from ${BINARY_URL}\n"
-
- wasmer_download_file "$BINARY_URL" "$DOWNLOAD_FILE" || return 1
-
- printf "\033[K\n\033[1A"
-
- wasmer_install_status "installing" "${INSTALL_DIRECTORY}"
-
- mkdir -p $INSTALL_DIRECTORY
-
- # Untar the WAPM contents in the install directory
- tar -C $INSTALL_DIRECTORY -zxf $DOWNLOAD_FILE
-}
-
-wasmer_error() {
- printf "$bold${red}error${white}: $1${reset}\n"
-}
-
-wasmer_install_status() {
- printf "$bold${green}${1}${white}: $2${reset}\n"
-}
-
-wasmer_warning() {
- printf "$bold${yellow}warning${white}: $1${reset}\n"
-}
-
-wasmer_verify_or_quit() {
- if [ -n "$BASH_VERSION" ]; then
- # If we are in bash, we can use read -n
- read -p "$1 [y/N] " -n 1 -r
- echo
- if [[ ! $REPLY =~ ^[Yy]$ ]]; then
- wasmer_error "installation aborted"
- return 1
- fi
- return 0
- fi
-
- read -p "$1 [y/N]" yn
- case $yn in
- [Yy]*) break ;;
- [Nn]*)
- wasmer_error "installation aborted"
- return 1
- ;;
- *) echo "Please answer yes or no." ;;
- esac
-
- return 0
-}
-
-# determine install directory if required
-if [ -z "$WASMER_DIR" ]; then
- # If WASMER_DIR is not present
- INSTALL_DIRECTORY="$HOME/.wasmer"
-else
- # If WASMER_DIR is present
- INSTALL_DIRECTORY="${WASMER_DIR}"
-fi
-
-wasmer_install $1 # $2
diff --git a/env/wasip1-wasm-wasmtime/Dockerfile b/env/wasip1-wasm-wasmtime/Dockerfile
deleted file mode 100644
index 4cc46b6..0000000
--- a/env/wasip1-wasm-wasmtime/Dockerfile
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright 2022 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-ARG REPO
-
-FROM debian:latest as builder
-LABEL maintainer="golang-dev@googlegroups.com"
-
-RUN apt-get update && apt-get -y install curl xz-utils
-
-# A copy of https://wasmtime.dev/install.sh.
-COPY install.sh install.sh
-
-RUN bash install.sh --version v9.0.1
-
-FROM ${REPO}/linux-x86-sid:20221109
-
-COPY --from=builder /root/.wasmtime/bin/wasmtime /usr/local/bin/wasmtime
-
-CMD ["/usr/local/bin/stage0"]
diff --git a/env/wasip1-wasm-wasmtime/Makefile b/env/wasip1-wasm-wasmtime/Makefile
deleted file mode 100644
index 386325c..0000000
--- a/env/wasip1-wasm-wasmtime/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-# Copyright 2023 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-IMAGE_NAME=$(shell basename $(CURDIR))
-PROD_REPO=gcr.io/symbolic-datum-552
-
-usage:
- echo "Use prod or dev targets. For dev, specify your Docker repository with the REPO=foo argument." ; exit 1
-
-prod: Dockerfile
- docker build -t $(PROD_REPO)/$(IMAGE_NAME):latest --build-arg REPO=$(PROD_REPO) -f Dockerfile .
-
-pushprod: prod
- docker push $(PROD_REPO)/$(IMAGE_NAME):latest
-
-# You must provide a REPO=your-repo-name arg when you make
-# this target. REPO is the name of the Docker repository
-# that will be prefixed to the name of the image being built.
-dev: Dockerfile
- docker build -t $(REPO)/$(IMAGE_NAME):latest --build-arg REPO=$(REPO) -f Dockerfile .
- docker push $(REPO)/$(IMAGE_NAME):latest
diff --git a/env/wasip1-wasm-wasmtime/install.sh b/env/wasip1-wasm-wasmtime/install.sh
deleted file mode 100644
index b79cd43..0000000
--- a/env/wasip1-wasm-wasmtime/install.sh
+++ /dev/null
@@ -1,550 +0,0 @@
-#!/usr/bin/env bash
-
-# Copied from
-# https://github.com/volta-cli/volta/blob/master/dev/unix/volta-install.sh
-
-# LICENSE:
-
-# BSD 2-CLAUSE LICENSE
-#
-# Copyright (c) 2017, The Wasmtime Contributors.
-# All rights reserved.
-#
-# This product includes:
-#
-# Contributions from LinkedIn Corporation
-# Copyright (c) 2017, LinkedIn Corporation.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# 1. Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following disclaimer in the documentation
-# and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# The views and conclusions contained in the software and documentation are those
-# of the authors and should not be interpreted as representing official policies,
-# either expressed or implied, of the FreeBSD Project.
-
-get_latest_release() {
- curl --silent "https://api.github.com/repos/bytecodealliance/wasmtime/releases/latest" | \
- grep tag_name | \
- cut -d '"' -f 4
-}
-
-release_url() {
- echo "https://github.com/bytecodealliance/wasmtime/releases"
-}
-
-download_release_from_repo() {
- local version="$1"
- local arch="$2"
- local os_info="$3"
- local tmpdir="$4"
-
- local filename="wasmtime-$version-$arch-$os_info.tar.xz"
- local download_file="$tmpdir/$filename"
- local archive_url="$(release_url)/download/$version/$filename"
- info $archive_url
-
- curl --progress-bar --show-error --location --fail "$archive_url" \
- --output "$download_file" && echo "$download_file"
-}
-
-usage() {
- cat >&2 <<END_USAGE
-wasmtime-install: The installer for Wasmtime
-
-USAGE:
- wasmtime-install [FLAGS] [OPTIONS]
-
-FLAGS:
- -h, --help Prints help information
-
-OPTIONS:
- --dev Compile and install Wasmtime locally, using the dev target
- --release Compile and install Wasmtime locally, using the release target
- --version <version> Install a specific release version of Wasmtime
-END_USAGE
-}
-
-info() {
- local action="$1"
- local details="$2"
- command printf '\033[1;32m%12s\033[0m %s\n' "$action" "$details" 1>&2
-}
-
-error() {
- command printf '\033[1;31mError\033[0m: %s\n\n' "$1" 1>&2
-}
-
-warning() {
- command printf '\033[1;33mWarning\033[0m: %s\n\n' "$1" 1>&2
-}
-
-request() {
- command printf '\033[1m%s\033[0m\n' "$1" 1>&2
-}
-
-eprintf() {
- command printf '%s\n' "$1" 1>&2
-}
-
-bold() {
- command printf '\033[1m%s\033[0m' "$1"
-}
-
-# If file exists, echo it
-echo_fexists() {
- [ -f "$1" ] && echo "$1"
-}
-
-detect_profile() {
- local shellname="$1"
- local uname="$2"
-
- if [ -f "$PROFILE" ]; then
- echo "$PROFILE"
- return
- fi
-
- # try to detect the current shell
- case "$shellname" in
- bash)
- # Shells on macOS default to opening with a login shell, while Linuxes
- # default to a *non*-login shell, so if this is macOS we look for
- # `.bash_profile` first; if it's Linux, we look for `.bashrc` first. The
- # `*` fallthrough covers more than just Linux: it's everything that is not
- # macOS (Darwin). It can be made narrower later if need be.
- case $uname in
- Darwin)
- echo_fexists "$HOME/.bash_profile" || echo_fexists "$HOME/.bashrc"
- ;;
- *)
- echo_fexists "$HOME/.bashrc" || echo_fexists "$HOME/.bash_profile"
- ;;
- esac
- ;;
- zsh)
- echo "$HOME/.zshrc"
- ;;
- fish)
- echo "$HOME/.config/fish/config.fish"
- ;;
- *)
- # Fall back to checking for profile file existence. Once again, the order
- # differs between macOS and everything else.
- local profiles
- case $uname in
- Darwin)
- profiles=( .profile .bash_profile .bashrc .zshrc .config/fish/config.fish )
- ;;
- *)
- profiles=( .profile .bashrc .bash_profile .zshrc .config/fish/config.fish )
- ;;
- esac
-
- for profile in "${profiles[@]}"; do
- echo_fexists "$HOME/$profile" && break
- done
- ;;
- esac
-}
-
-# generate shell code to source the loading script and modify the path for the input profile
-build_path_str() {
- local profile="$1"
- local profile_install_dir="$2"
-
- if [[ $profile =~ \.fish$ ]]; then
- # fish uses a little different syntax to modify the PATH
- cat <<END_FISH_SCRIPT
-
-set -gx WASMTIME_HOME "$profile_install_dir"
-
-string match -r ".wasmtime" "\$PATH" > /dev/null; or set -gx PATH "\$WASMTIME_HOME/bin" \$PATH
-END_FISH_SCRIPT
- else
- # bash and zsh
- cat <<END_BASH_SCRIPT
-
-export WASMTIME_HOME="$profile_install_dir"
-
-export PATH="\$WASMTIME_HOME/bin:\$PATH"
-END_BASH_SCRIPT
- fi
-}
-
-# check for issue with WASMTIME_HOME
-# if it is set, and exists, but is not a directory, the install will fail
-wasmtime_home_is_ok() {
- if [ -n "${WASMTIME_HOME-}" ] && [ -e "$WASMTIME_HOME" ] && ! [ -d "$WASMTIME_HOME" ]; then
- error "\$WASMTIME_HOME is set but is not a directory ($WASMTIME_HOME)."
- eprintf "Please check your profile scripts and environment."
- return 1
- fi
- return 0
-}
-
-update_profile() {
- local install_dir="$1"
-
- local profile_install_dir=$(echo "$install_dir" | sed "s:^$HOME:\$HOME:")
- local detected_profile="$(detect_profile $(basename "/$SHELL") $(uname -s) )"
- local path_str="$(build_path_str "$detected_profile" "$profile_install_dir")"
- info 'Editing' "user profile ($detected_profile)"
-
- if [ -z "${detected_profile-}" ] ; then
- error "No user profile found."
- eprintf "Tried \$PROFILE ($PROFILE), ~/.bashrc, ~/.bash_profile, ~/.zshrc, ~/.profile, and ~/.config/fish/config.fish."
- eprintf ''
- eprintf "You can either create one of these and try again or add this to the appropriate file:"
- eprintf "$path_str"
- return 1
- else
- if ! command grep -qc 'WASMTIME_HOME' "$detected_profile"; then
- command printf "$path_str" >> "$detected_profile"
- else
- warning "Your profile ($detected_profile) already mentions Wasmtime and has not been changed."
- fi
- fi
-}
-
-# Check if it is OK to upgrade to the new version
-upgrade_is_ok() {
- local will_install_version="$1"
- local install_dir="$2"
- local is_dev_install="$3"
-
- local wasmtime_bin="$install_dir/wasmtime"
-
- if [[ -n "$install_dir" && -x "$wasmtime_bin" ]]; then
- local prev_version="$( ($wasmtime_bin --version 2>/dev/null || echo 0.1) | sed -E 's/^.*([0-9]+\.[0-9]+\.[0-9]+).*$/\1/')"
- # if this is a local dev install, skip the equality check
- # if installing the same version, this is a no-op
- if [ "$is_dev_install" != "true" ] && [ "$prev_version" == "$will_install_version" ]; then
- eprintf "Version $will_install_version already installed"
- return 1
- fi
- # in the future, check $prev_version for incompatible upgrades
- fi
- return 0
-}
-
-# returns the os name to be used in the packaged release,
-# including the openssl info if necessary
-parse_os_info() {
- local uname_str="$1"
- local openssl_version="$2"
-
- case "$uname_str" in
- Linux)
- echo "linux"
- ;;
- Darwin)
- echo "macos"
- ;;
- *)
- return 1
- esac
- return 0
-}
-
-parse_os_pretty() {
- local uname_str="$1"
-
- case "$uname_str" in
- Linux)
- echo "Linux"
- ;;
- Darwin)
- echo "macOS"
- ;;
- *)
- echo "$uname_str"
- esac
-}
-
-# return true(0) if the element is contained in the input arguments
-# called like:
-# if element_in "foo" "${array[@]}"; then ...
-element_in() {
- local match="$1";
- shift
-
- local element;
- # loop over the input arguments and return when a match is found
- for element in "$@"; do
- [ "$element" == "$match" ] && return 0
- done
- return 1
-}
-
-create_tree() {
- local install_dir="$1"
-
- info 'Creating' "directory layout"
-
- # .wasmtime/
- # bin/
-
- mkdir -p "$install_dir"
- mkdir -p "$install_dir"/bin
-}
-
-install_version() {
- local version_to_install="$1"
- local install_dir="$2"
-
- if ! wasmtime_home_is_ok; then
- exit 1
- fi
-
- case "$version_to_install" in
- latest)
- local latest_version="$(get_latest_release)"
- info 'Installing' "latest version of Wasmtime ($latest_version)"
- install_release "$latest_version" "$install_dir"
- ;;
- local-dev)
- info 'Installing' "Wasmtime locally after compiling"
- install_local "dev" "$install_dir"
- ;;
- local-release)
- info 'Installing' "Wasmtime locally after compiling with '--release'"
- install_local "release" "$install_dir"
- ;;
- *)
- # assume anything else is a specific version
- info 'Installing' "Wasmtime version $version_to_install"
- install_release "$version_to_install" "$install_dir"
- ;;
- esac
-
- if [ "$?" == 0 ]
- then
- update_profile "$install_dir" &&
- info "Finished" 'installation. Open a new terminal to start using Wasmtime!'
- fi
-}
-
-# parse the 'version = "X.Y.Z"' line from the input Cargo.toml contents
-# and return the version string
-parse_cargo_version() {
- local contents="$1"
-
- while read -r line
- do
- if [[ "$line" =~ ^version\ =\ \"(.*)\" ]]
- then
- echo "${BASH_REMATCH[1]}"
- return 0
- fi
- done <<< "$contents"
-
- error "Could not determine the current version from Cargo.toml"
- return 1
-}
-
-install_release() {
- local version="$1"
- local install_dir="$2"
- local is_dev_install="false"
-
- info 'Checking' "for existing Wasmtime installation"
- if upgrade_is_ok "$version" "$install_dir" "$is_dev_install"
- then
- download_archive="$(download_release "$version"; exit "$?")"
- exit_status="$?"
- if [ "$exit_status" != 0 ]
- then
- error "Could not download Wasmtime version '$version'. See $(release_url) for a list of available releases"
- return "$exit_status"
- fi
-
- install_from_file "$download_archive" "$install_dir"
- else
- # existing legacy install, or upgrade problem
- return 1
- fi
-}
-
-install_local() {
- local dev_or_release="$1"
- local install_dir="$2"
- # this is a local install, so skip the version equality check
- local is_dev_install="true"
-
- info 'Checking' "for existing Wasmtime installation"
- install_version="$(parse_cargo_version "$(<Cargo.toml)" )" || return 1
- if no_legacy_install && upgrade_is_ok "$install_version" "$install_dir" "$is_dev_install"
- then
- # compile and package the binaries, then install from that local archive
- compiled_archive="$(compile_and_package "$dev_or_release")" &&
- install_from_file "$compiled_archive" "$install_dir"
- else
- # existing legacy install, or upgrade problem
- return 1
- fi
-}
-
-compile_and_package() {
- local dev_or_release="$1"
-
- local release_output
-
- # get the directory of this script
- # (from https://stackoverflow.com/a/246128)
- DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
-
- # call the release script to create the packaged archive file
- # '2> >(tee /dev/stderr)' copies stderr to stdout, to collect it and parse the filename
- release_output="$( "$DIR/release.sh" "--$dev_or_release" 2> >(tee /dev/stderr) )"
- [ "$?" != 0 ] && return 1
-
- # parse the release filename and return that
- if [[ "$release_output" =~ release\ in\ file\ (target[^\ ]+) ]]; then
- echo "${BASH_REMATCH[1]}"
- else
- error "Could not determine output filename"
- return 1
- fi
-}
-
-download_release() {
- local version="$1"
-
- local arch="$(get_architecture)"
- local uname_str="$(uname -s)"
- local os_info
- os_info="$(parse_os_info "$uname_str")"
- if [ "$?" != 0 ]; then
- error "The current operating system ($uname_str) does not appear to be supported by Wasmtime."
- return 1
- fi
- local pretty_os_name="$(parse_os_pretty "$uname_str")"
-
- info 'Fetching' "archive for $pretty_os_name, version $version"
- # store the downloaded archive in a temporary directory
- local download_dir="$(mktemp -d)"
- download_release_from_repo "$version" "$arch" "$os_info" "$download_dir"
-}
-
-install_from_file() {
- local archive="$1"
- local copy_to="$2"
- local extract_to="$(dirname $archive)"
- local extracted_path="$extract_to/$(basename $archive .tar.xz)"
-
- create_tree "$copy_to"
-
- info 'Extracting' "Wasmtime binaries"
- # extract the files to the temp directory
- tar -xvf "$archive" -C "$extract_to"
-
- # copy the files to the specified directory
- # binaries go into the bin folder
- cp "$extracted_path/wasmtime" "$copy_to/bin"
-
- # the others directly into the specified folder
- cp "$extracted_path/LICENSE" "$extracted_path/README.md" "$copy_to"
-}
-
-get_architecture() {
- local arch="$(uname -m)"
- case "$arch" in
- # macOS on aarch64 says "arm64" instead.
- arm64)
- arch=aarch64
- ;;
- esac
- echo "$arch"
-}
-
-check_architecture() {
- local version="$1"
- local arch="$2"
- local os="$3"
-
- # Local version always allowed.
- if [[ "$version" == "local"* ]]; then
- return 0
- fi
-
- # Otherwise, check the matrix of OS/architecture support.
- case "$arch/$os" in
- aarch64/Linux)
- return 0
- ;;
- aarch64/Darwin)
- return 0
- ;;
- s390x/Linux)
- return 0
- ;;
- x86_64/*)
- return 0
- ;;
- esac
-
- error "Sorry! Wasmtime currently only provides pre-built binaries for x86_64 (Linux, macOS, Windows), aarch64 (Linux, macOS), and s390x (Linux)."
- return 1
-}
-
-
-# return if sourced (for testing the functions above)
-return 0 2>/dev/null
-
-# default to installing the latest available version
-version_to_install="latest"
-
-# install to WASMTIME_HOME, defaulting to ~/.wasmtime
-install_dir="${WASMTIME_HOME:-"$HOME/.wasmtime"}"
-
-# parse command line options
-while [ $# -gt 0 ]
-do
- arg="$1"
-
- case "$arg" in
- -h|--help)
- usage
- exit 0
- ;;
- --dev)
- shift # shift off the argument
- version_to_install="local-dev"
- ;;
- --release)
- shift # shift off the argument
- version_to_install="local-release"
- ;;
- --version)
- shift # shift off the argument
- version_to_install="$1"
- shift # shift off the value
- ;;
- *)
- error "unknown option: '$arg'"
- usage
- exit 1
- ;;
- esac
-done
-
-check_architecture "$version_to_install" "$(get_architecture)" "$(uname)" || exit 1
-
-install_version "$version_to_install" "$install_dir"
diff --git a/env/wasip1-wasm-wazero/Dockerfile b/env/wasip1-wasm-wazero/Dockerfile
deleted file mode 100644
index b4cd1ad..0000000
--- a/env/wasip1-wasm-wazero/Dockerfile
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright 2023 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-ARG REPO
-
-FROM golang:latest as builder
-LABEL maintainer="golang-dev@googlegroups.com"
-
-RUN go install github.com/tetratelabs/wazero/cmd/wazero@v1.3.1
-
-FROM ${REPO}/linux-x86-sid:20221109
-
-COPY --from=builder /go/bin/wazero /usr/local/bin/wazero
-
-CMD ["/usr/local/bin/stage0"]
diff --git a/env/wasip1-wasm-wazero/Makefile b/env/wasip1-wasm-wazero/Makefile
deleted file mode 100644
index 386325c..0000000
--- a/env/wasip1-wasm-wazero/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-# Copyright 2023 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-IMAGE_NAME=$(shell basename $(CURDIR))
-PROD_REPO=gcr.io/symbolic-datum-552
-
-usage:
- echo "Use prod or dev targets. For dev, specify your Docker repository with the REPO=foo argument." ; exit 1
-
-prod: Dockerfile
- docker build -t $(PROD_REPO)/$(IMAGE_NAME):latest --build-arg REPO=$(PROD_REPO) -f Dockerfile .
-
-pushprod: prod
- docker push $(PROD_REPO)/$(IMAGE_NAME):latest
-
-# You must provide a REPO=your-repo-name arg when you make
-# this target. REPO is the name of the Docker repository
-# that will be prefixed to the name of the image being built.
-dev: Dockerfile
- docker build -t $(REPO)/$(IMAGE_NAME):latest --build-arg REPO=$(REPO) -f Dockerfile .
- docker push $(REPO)/$(IMAGE_NAME):latest