[installer] Add occlum golang debian installer
This commit is contained in:
		
							parent
							
								
									64c75e6d40
								
							
						
					
					
						commit
						4871f15e14
					
				| @ -12,6 +12,10 @@ on: | ||||
|         description: 'Need build new glibc package? <Y/N>' | ||||
|         required: true | ||||
|         default: 'N' | ||||
|       update_golang: | ||||
|         description: 'Need build new golang package? <Y/N>' | ||||
|         required: true | ||||
|         default: 'N' | ||||
|       only_test: | ||||
|         description: 'Only Test? <Y/N>' | ||||
|         required: true | ||||
| @ -75,6 +79,10 @@ jobs: | ||||
|       if: github.event.inputs.update_glibc == 'Y' | ||||
|       run: docker exec ubuntu bash -c "cd /root/workspace/occlum/tools/installer/deb; make glibc" | ||||
| 
 | ||||
|     - name: Build golang toolchain package | ||||
|       if: github.event.inputs.update_golang == 'Y' | ||||
|       run: docker exec ubuntu bash -c "cd /root/workspace/occlum/tools/installer/deb; make golang" | ||||
| 
 | ||||
|     - name: Prepare tools and keys    # Since aptly still use gpg1 by default, we all use gpg1 as gpg tool. | ||||
|       run: docker exec ubuntu bash -c 'apt-get update; apt-get install -y tree apt-utils gnupg reprepro rng-tools aptly; rm -rf /root/.gnupg; | ||||
|             echo "${{ secrets.DEB_PRIVATE_KEY }}" > /root/deb_private_key; gpg1 --allow-secret-key-import --import /root/deb_private_key; | ||||
|  | ||||
| @ -17,11 +17,9 @@ C_TOOLCHAIN_PACKAGE_NAME := occlum-toolchains-gcc | ||||
| # When updating the toolchain packages for Deb, please first update RPM configuration. And then
 | ||||
| # update the "changelog" file accordingly.
 | ||||
| MUSL_VERSION := 0.27.0 | ||||
| GOLAN_VERSION := 0.16.0 | ||||
| GOLAN_VERSION := 1.18.4 | ||||
| GLIBC_VERSION := 2.31 | ||||
| 
 | ||||
| GO_PATCH = $(PROJECT_DIR)/tools/toolchains/golang/adapt-golang-to-occlum.patch | ||||
| 
 | ||||
| .PHONY: all main config_files main_deps musl-gcc deps_c glibc deps_glibc clean clean-build | ||||
| 
 | ||||
| all: main | ||||
| @ -77,7 +75,6 @@ deps_golang: | ||||
| 	mkdir -p $(TARGET_DIR) | ||||
| 	mkdir -p $(DEB_BUILD_DIR)/occlum-toolchains-golang | ||||
| 	cp -r toolchains/golang $(DEB_BUILD_DIR)/occlum-toolchains-golang/debian | ||||
| 	cp -t $(DEB_BUILD_DIR)/occlum-toolchains-golang/debian $(GO_PATCH) $(PROJECT_DIR)/tools/installer/rpm/toolchains/golang/occlum-go.sh | ||||
| 
 | ||||
| glibc: deps_glibc | ||||
| 	cd $(DEB_BUILD_DIR)/occlum-toolchains-glibc ; \
 | ||||
|  | ||||
| @ -1,3 +1,9 @@ | ||||
| occlum-toolchains-golang (1.18.4-1) unstable; urgency=medium | ||||
| 
 | ||||
|   * Upgrade golang version to 1.18.4 | ||||
| 
 | ||||
|   -- Qi Zheng <huaiqing.zq@antgroup.com>  Tue, 1 Nov 2022 17:16:9 +0000 | ||||
| 
 | ||||
| occlum-toolchains-golang (0.16.0-1) unstable; urgency=medium | ||||
| 
 | ||||
|   * Initial release | ||||
|  | ||||
							
								
								
									
										1
									
								
								tools/installer/deb/toolchains/golang/occlum-go.sh
									
									
									
									
									
										Normal file
									
								
							
							
								
								
								
								
								
									
									
								
							
						
						
									
										1
									
								
								tools/installer/deb/toolchains/golang/occlum-go.sh
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1 @@ | ||||
| export PATH="$PATH:/opt/occlum/toolchains/golang/bin" | ||||
| @ -9,12 +9,9 @@ export install_dir = $(buildroot)/opt/occlum/toolchains/golang | ||||
| 
 | ||||
| SHELL = /bin/bash | ||||
| 
 | ||||
| # Needed by musl-cross-make config | ||||
| TARGET = x86_64-linux-musl | ||||
| GCC_VER = 8.3.0 | ||||
| GO_VERSION = 1.13.7 | ||||
| GO_REPO = https://github.com/golang/go/archive/go$(GO_VERSION).tar.gz | ||||
| GO_PATCH = adapt-golang-to-occlum.patch | ||||
| # go1.18.4_for_occlum or go1.16.3_for_occlum | ||||
| GO_BRANCH = go1.18.4_for_occlum | ||||
| GO_REPO = https://github.com/occlum/go.git | ||||
| 
 | ||||
| .ONESHELL: prepare override_dh_install | ||||
| 
 | ||||
| @ -27,19 +24,15 @@ prepare: | ||||
| 	rm -rf $(install_dir) | ||||
| 	mkdir -p $(tmp_build_dir) | ||||
| 	cd $(tmp_build_dir) | ||||
| 	wget $(GO_REPO) | ||||
| 	tar -xvzf go$(GO_VERSION).tar.gz | ||||
| 	cd go-go$(GO_VERSION) | ||||
| 	patch -p1 < $(deb_build_dir)/$(name)/debian/$(GO_PATCH) | ||||
| 	git clone -b $(GO_BRANCH) $(GO_REPO) . | ||||
| 
 | ||||
| override_dh_auto_build: prepare | ||||
| 	cd $(tmp_build_dir)/go-go$(GO_VERSION)/src; \ | ||||
| 		export GO_LDFLAGS="-compressdwarf=false"; \ | ||||
| 	cd $(tmp_build_dir)/src; \ | ||||
| 		./make.bash | ||||
| 
 | ||||
| override_dh_install: | ||||
| 	mkdir -p $(buildroot)/opt/occlum/toolchains | ||||
| 	mv $(tmp_build_dir)/go-go$(GO_VERSION)/ $(install_dir) | ||||
| 	mv $(tmp_build_dir)/ $(install_dir) | ||||
| 	rm -rf $(install_dir)/.git* | ||||
| 	cat > $(install_dir)/bin/occlum-go <<EOF | ||||
| 		#!/bin/bash | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user