diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index fa16ad46..5c8a7f29 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -59,7 +59,7 @@ jobs: submodules: recursive fetch-depth: 0 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 - name: Prepare id: prepare run: | diff --git a/etc/docker/environment/Dockerfile b/etc/docker/environment/Dockerfile index d2e86d49..116915b2 100644 --- a/etc/docker/environment/Dockerfile +++ b/etc/docker/environment/Dockerfile @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, The OTNS Authors. +# Copyright (c) 2022-2024, The OTNS Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. -FROM golang:1.18 +FROM golang:1.22 RUN apt-get update && apt-get install -y python3 python3-pip sudo unzip nodejs npm git && rm -rf /var/lib/apt/lists/* diff --git a/etc/docker/playground/Dockerfile b/etc/docker/playground/Dockerfile index a966cee8..82abc0f5 100644 --- a/etc/docker/playground/Dockerfile +++ b/etc/docker/playground/Dockerfile @@ -1,4 +1,4 @@ -# Copyright (c) 2020, The OTNS Authors. +# Copyright (c) 2020-2024, The OTNS Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -25,7 +25,7 @@ # POSSIBILITY OF SUCH DAMAGE. # Stage 0: build OTNS and dependencies -FROM golang:1.18 +FROM golang:1.22 RUN apt-get update RUN apt-get install -y python3 python3-pip unzip @@ -33,13 +33,8 @@ RUN apt-get install -y python3 python3-pip unzip COPY . /otns WORKDIR /otns RUN ./script/install-deps +RUN ./script/test build-openthread-versions RUN ./script/install -WORKDIR /otns/ot-rfsim -RUN ./script/bootstrap -RUN ./script/build_latest -RUN ./script/build_v11 -RUN ./script/build_v12 -RUN ./script/build_v13 RUN strip /go/bin/grpcwebproxy /go/bin/otns diff --git a/ot-rfsim/script/bootstrap b/ot-rfsim/script/bootstrap deleted file mode 100755 index 1de50f60..00000000 --- a/ot-rfsim/script/bootstrap +++ /dev/null @@ -1,98 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2017-2024, The OpenThread Authors. -# All rights reserved. -# -# 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. -# 3. Neither the name of the copyright holder nor the -# names of its contributors may be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# 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 HOLDER 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. -# -# Description: -# This file installs all needed dependencies and toolchains needed for -# ot-rfsim compilation and programming. -# - -set -euxo pipefail - -install_packages_apt() -{ - echo 'Installing toolchain dependencies...' - - # apt-get update and install dependencies - apt-get update - apt-get --no-install-recommends install -y g++ lsb-release cmake ninja-build shellcheck -} - -install_packages_opkg() -{ - echo 'opkg not supported currently' && false -} - -install_packages_rpm() -{ - echo 'rpm not supported currently' && false -} - -install_packages_brew() -{ - echo 'Installing toolchain dependencies...' - - # add build tools - brew install cmake ninja shfmt shellcheck - - # check for gcc for simulation - if ! command -v gcc; then - echo 'warning: clang/gcc needed for simulation' - echo 'warning: please install Command Line Tools from https://developer.apple.com/download/more/' - fi -} - -install_packages_source() -{ - echo 'source not supported currently' && false -} - -install_packages() -{ - PM=source - if command -v apt-get; then - PM=apt - elif command -v rpm; then - PM=rpm - elif command -v opkg; then - PM=opkg - elif command -v brew; then - PM=brew - fi - install_packages_$PM -} - -main() -{ - if [ "$EUID" -ne 0 ]; then - echo "Please run as root user, e.g. 'sudo ./script/bootstrap'." && false - fi - install_packages - echo 'bootstrap for ot-rfsim completed successfully.' -} - -main