From bb8fe9e00a52e38231792348981fa78232c36689 Mon Sep 17 00:00:00 2001 From: Mingfun Wong Date: Sun, 21 Jan 2024 12:59:09 +0900 Subject: [PATCH] upgrade to ubuntu 24.04 --- .devcontainer/devcontainer.json | 4 ++ Dockerfile | 11 ++-- build-docker-and-run.sh | 6 -- install-from-helm.sh | 42 ------------- k8s.yaml | 108 -------------------------------- start.sh | 4 +- 6 files changed, 13 insertions(+), 162 deletions(-) create mode 100644 .devcontainer/devcontainer.json delete mode 100755 build-docker-and-run.sh delete mode 100755 install-from-helm.sh delete mode 100644 k8s.yaml mode change 100755 => 100644 start.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..fcf7e11 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,4 @@ +{ + "name": "ubuntu 24.04", + "image": "ubuntu:24.04" +} diff --git a/Dockerfile b/Dockerfile index dfbefba..7bad00e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,12 @@ -FROM ubuntu:latest +FROM ubuntu:24.04 -WORKDIR /fibos +WORKDIR /app RUN apt-get update -y \ - && apt-get install -y curl sudo wget libusb-1.0-0 libcurl3-gnutls libncurses5 \ + && apt-get install -y curl sudo wget libusb-1.0-0 libcurl3-gnutls \ + && wget "http://security.ubuntu.com/ubuntu/pool/main/n/ncurses/libtinfo5_6.1-1ubuntu1_amd64.deb" \ + && dpkg -i libtinfo5_6.1-1ubuntu1_amd64.deb \ + && rm libtinfo5_6.1-1ubuntu1_amd64.deb \ && wget "http://security.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5_amd64.deb" \ && dpkg -i libssl1.0.0_1.0.2n-1ubuntu5_amd64.deb \ && rm libssl1.0.0_1.0.2n-1ubuntu5_amd64.deb \ @@ -20,4 +23,4 @@ ADD start.sh . EXPOSE 8080 -ENTRYPOINT ["bash", "/fibos/start.sh"] +ENTRYPOINT ["bash", "/app/start.sh"] diff --git a/build-docker-and-run.sh b/build-docker-and-run.sh deleted file mode 100755 index 5930341..0000000 --- a/build-docker-and-run.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -set -e - -docker build -t mingfunwong/fibos:1.7.1.13 . -docker-compose down -docker-compose up \ No newline at end of file diff --git a/install-from-helm.sh b/install-from-helm.sh deleted file mode 100755 index 6ab6130..0000000 --- a/install-from-helm.sh +++ /dev/null @@ -1,42 +0,0 @@ -# install k3s -curl -sfL https://get.k3s.io | sh - -# install helm -curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash -# setup helm -mkdir ~/.kube -kubectl config view --raw >~/.kube/config -# add helm repo -helm repo add mingfunwong https://mingfunwong.github.io/helm-charts - -# name -NAME=fibos-node-1 -# enable block producers -PRODUCER_ENABLE=false -# block producer information -PRODUCER_NAME= -PUBLIC_KEY= -PRIVATE_KEY= -# enable the producer api -PRODUCER_API_ENABLE=false -# use a snapshot -SNAPSHOT_ENABLE=true -# snapshot url -SNAPSHOT_URL=https://snapshots.fibos123.com/latest.bin -# enable provide -HTTP_ENABLE=false -# provide information -HTTP_HOST= -P2P_PORT= - -# install fibos-node -helm install $NAME mingfunwong/fibos-node \ - --set PRODUCER_ENABLE=$PRODUCER_ENABLE \ - --set PRODUCER_NAME=$PRODUCER_NAME \ - --set PUBLIC_KEY=$PUBLIC_KEY \ - --set PRIVATE_KEY=$PRIVATE_KEY \ - --set PRODUCER_API_ENABLE=$PRODUCER_API_ENABLE \ - --set SNAPSHOT_ENABLE=$SNAPSHOT_ENABLE \ - --set SNAPSHOT_URL=$SNAPSHOT_URL \ - --set ingress.enabled=$HTTP_ENABLE \ - --set ingress.hosts.host=$HTTP_HOST \ - --set service.p2pPort=$P2P_PORT diff --git a/k8s.yaml b/k8s.yaml deleted file mode 100644 index 3e5b7a9..0000000 --- a/k8s.yaml +++ /dev/null @@ -1,108 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: fibos-node-1-service - labels: - app: fibos-node-1 -spec: - type: NodePort - ports: - - name: '8080' - port: 8080 - targetPort: 8080 - - name: '30977' - port: 30977 - targetPort: 9977 - nodePort: 30977 - selector: - app: fibos-node-1 ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: fibos-node-1-config -data: - PRODUCER_ENABLE: 'false' - PRODUCER_NAME: '' - PUBLIC_KEY: '' - PRIVATE_KEY: '' - PRODUCER_API_ENABLE: 'false' - SNAPSHOT_ENABLE: 'true' - SNAPSHOT_URL: https://snapshots.fibos123.com/latest.bin ---- -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: fibos-node-1-ingress -spec: - rules: - - host: - http: - paths: - - pathType: Prefix - path: / - backend: - service: - name: fibos-node-1-service - port: - number: 8080 ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - creationTimestamp: null - name: fibos-node-1 - labels: - app: fibos-node-1 -spec: - replicas: 1 - selector: - matchLabels: - app: fibos-node-1 - strategy: {} - template: - metadata: - creationTimestamp: null - labels: - app: fibos-node-1 - spec: - containers: - - image: mingfunwong/fibos:v1.7.1.12 - name: fibos - resources: {} - env: - - name: PRODUCER_ENABLE - valueFrom: - configMapKeyRef: - name: fibos-node-1-config - key: PRODUCER_ENABLE - - name: PRODUCER_NAME - valueFrom: - configMapKeyRef: - name: fibos-node-1-config - key: PRODUCER_NAME - - name: PUBLIC_KEY - valueFrom: - configMapKeyRef: - name: fibos-node-1-config - key: PUBLIC_KEY - - name: PRIVATE_KEY - valueFrom: - configMapKeyRef: - name: fibos-node-1-config - key: PRIVATE_KEY - - name: PRODUCER_API_ENABLE - valueFrom: - configMapKeyRef: - name: fibos-node-1-config - key: PRODUCER_API_ENABLE - - name: SNAPSHOT_ENABLE - valueFrom: - configMapKeyRef: - name: fibos-node-1-config - key: SNAPSHOT_ENABLE - - name: SNAPSHOT_URL - valueFrom: - configMapKeyRef: - name: fibos-node-1-config - key: SNAPSHOT_URL diff --git a/start.sh b/start.sh old mode 100755 new mode 100644 index e2ea917..426bb9e --- a/start.sh +++ b/start.sh @@ -3,7 +3,7 @@ set -e SNAPSHOT_FOLDER=./data/snapshots -if [ "$SNAPSHOT_ENABLE" = "true" ]; then +if [ "$SNAPSHOT_ENABLE" != "false" ]; then export SNAPSHOT_FILE=$SNAPSHOT_FOLDER/snapshot.bin rm -rf ./data/* @@ -22,4 +22,4 @@ if [ "$SNAPSHOT_ENABLE" = "true" ]; then wget $SNAPSHOT_URL -O $SNAPSHOT_FILE fi -fibos /fibos/start.js +fibos ./start.js