docker 安装 bazel

  需要在docker container 内安装bazel 工具包。

1 下载 bazel。参考 https://docs.bazel.build/versions/master/install-ubuntu.html

https://github.com/bazelbuild/bazel/releases 

2 container 内做好准备工作,执行

root@4f2a38da633a:~/transformer# apt-get install pkg-config zip g++ zlib1g-dev unzip python
Reading package lists... Done
Building dependency tree       
Reading state information... Done
g++ is already the newest version (4:5.3.1-1ubuntu1).
g++ set to manually installed.
python is already the newest version (2.7.12-1~16.04).
The following additional packages will be installed:
  libglib2.0-0 libglib2.0-data libicu55 libxml2 sgml-base shared-mime-info xdg-user-dirs xml-core
Suggested packages:
  sgml-base-doc debhelper
The following NEW packages will be installed:
  libglib2.0-0 libglib2.0-data libicu55 libxml2 pkg-config sgml-base shared-mime-info unzip xdg-user-dirs xml-core zip zlib1g-dev
0 upgraded, 12 newly installed, 0 to remove and 15 not upgraded.
Need to get 10.6 MB of archives.
After this operation, 42.0 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu xenial/main amd64 sgml-base all 1.26+nmu4ubuntu1 [12.5 kB]
Get:2 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libglib2.0-0 amd64 2.48.2-0ubuntu3 [1120 kB]
Get:3 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libglib2.0-data all 2.48.2-0ubuntu3 [132 kB]
Get:4 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libicu55 amd64 55.1-7ubuntu0.4 [7646 kB]
Get:5 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libxml2 amd64 2.9.3+dfsg1-1ubuntu0.5 [697 kB]                                                       
Get:6 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 shared-mime-info amd64 1.5-2ubuntu0.2 [405 kB]                                                      
Get:7 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 xdg-user-dirs amd64 0.15-2ubuntu6.16.04.1 [61.8 kB]                                                 
Get:8 http://archive.ubuntu.com/ubuntu xenial/main amd64 xml-core all 0.13+nmu2 [23.3 kB]                                                                            
Get:9 http://archive.ubuntu.com/ubuntu xenial/main amd64 pkg-config amd64 0.29.1-0ubuntu1 [45.0 kB]                                                                  
Get:10 http://archive.ubuntu.com/ubuntu xenial/main amd64 unzip amd64 6.0-20ubuntu1 [158 kB]                                                                         
Get:11 http://archive.ubuntu.com/ubuntu xenial/main amd64 zip amd64 3.0-11 [158 kB]                                                                                  
Get:12 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 zlib1g-dev amd64 1:1.2.8.dfsg-2ubuntu4.1 [168 kB]                                                  
Fetched 10.6 MB in 8s (1220 kB/s)                                                                                                                                    
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package sgml-base.
(Reading database ... 13418 files and directories currently installed.)
Preparing to unpack .../sgml-base_1.26+nmu4ubuntu1_all.deb ...
Unpacking sgml-base (1.26+nmu4ubuntu1) ...
Selecting previously unselected package libglib2.0-0:amd64.
Preparing to unpack .../libglib2.0-0_2.48.2-0ubuntu3_amd64.deb ...
Unpacking libglib2.0-0:amd64 (2.48.2-0ubuntu3) ...
Selecting previously unselected package libglib2.0-data.
Preparing to unpack .../libglib2.0-data_2.48.2-0ubuntu3_all.deb ...
Unpacking libglib2.0-data (2.48.2-0ubuntu3) ...
Selecting previously unselected package libicu55:amd64.
Preparing to unpack .../libicu55_55.1-7ubuntu0.4_amd64.deb ...
Unpacking libicu55:amd64 (55.1-7ubuntu0.4) ...
Selecting previously unselected package libxml2:amd64.
Preparing to unpack .../libxml2_2.9.3+dfsg1-1ubuntu0.5_amd64.deb ...
Unpacking libxml2:amd64 (2.9.3+dfsg1-1ubuntu0.5) ...
Selecting previously unselected package shared-mime-info.
Preparing to unpack .../shared-mime-info_1.5-2ubuntu0.2_amd64.deb ...
Unpacking shared-mime-info (1.5-2ubuntu0.2) ...
Selecting previously unselected package xdg-user-dirs.
Preparing to unpack .../xdg-user-dirs_0.15-2ubuntu6.16.04.1_amd64.deb ...
Unpacking xdg-user-dirs (0.15-2ubuntu6.16.04.1) ...
Selecting previously unselected package xml-core.
Preparing to unpack .../xml-core_0.13+nmu2_all.deb ...
Unpacking xml-core (0.13+nmu2) ...
Selecting previously unselected package pkg-config.
Preparing to unpack .../pkg-config_0.29.1-0ubuntu1_amd64.deb ...
Unpacking pkg-config (0.29.1-0ubuntu1) ...
Selecting previously unselected package unzip.
Preparing to unpack .../unzip_6.0-20ubuntu1_amd64.deb ...
Unpacking unzip (6.0-20ubuntu1) ...
Selecting previously unselected package zip.
Preparing to unpack .../archives/zip_3.0-11_amd64.deb ...
Unpacking zip (3.0-11) ...
Selecting previously unselected package zlib1g-dev:amd64.
Preparing to unpack .../zlib1g-dev_1%3a1.2.8.dfsg-2ubuntu4.1_amd64.deb ...
Unpacking zlib1g-dev:amd64 (1:1.2.8.dfsg-2ubuntu4.1) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Setting up sgml-base (1.26+nmu4ubuntu1) ...
Setting up libglib2.0-0:amd64 (2.48.2-0ubuntu3) ...
No schema files found: doing nothing.
Setting up libglib2.0-data (2.48.2-0ubuntu3) ...
Setting up libicu55:amd64 (55.1-7ubuntu0.4) ...
Setting up libxml2:amd64 (2.9.3+dfsg1-1ubuntu0.5) ...
Setting up shared-mime-info (1.5-2ubuntu0.2) ...
Setting up xdg-user-dirs (0.15-2ubuntu6.16.04.1) ...
Setting up xml-core (0.13+nmu2) ...
Setting up pkg-config (0.29.1-0ubuntu1) ...
Setting up unzip (6.0-20ubuntu1) ...
Setting up zip (3.0-11) ...
Setting up zlib1g-dev:amd64 (1:1.2.8.dfsg-2ubuntu4.1) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Processing triggers for sgml-base (1.26+nmu4ubuntu1) ...

3 container 内执行

root@4f2a38da633a:~/transformer# ./bazel-0.16.0-installer-linux-x86_64.sh 
Bazel installer
---------------

Bazel is bundled with software licensed under the GPLv2 with Classpath exception.
You can find the sources next to the installer on our release page:
   https://github.com/bazelbuild/bazel/releases

# Release 0.16.0 (2018-07-31)

Baseline: 4f64b77a3dd8e4ccdc8077051927985f9578a3a5

Cherry picks:
   + 4c9a0c82d308d5df5c524e2a26644022ff525f3e:
     reduce the size of bazel's embedded jdk
   + d3228b61f633cdc5b3f740b641a0836f1bd79abd:
     remote: limit number of open tcp connections by default. Fixes
     #5491
   + 8ff87c164f48dbabe3b20becd00dde90c50d46f5:
     Fix autodetection of linker flags
   + c4622ac9205d2f1b42dac8c598e83113d39e7f11:
     Fix autodetection of -z linker flags
   + 10219659f58622d99034288cf9f491865f818218:
     blaze_util_posix.cc: fix order of #define
   + ab1f269017171223932e0da9bb539e8a17dd99ed:
     blaze_util_freebsd.cc: include path.h explicitly
   + 68e92b45a37f2142c768a56eb7ecfa484b8b22df:
     openjdk: update macOS openjdk image. Fixes #5532
   + f45c22407e6b00fcba706eb62141cb9036bd38d7:
     Set the start time of binary and JSON profiles to zero correctly.
   + bca1912853086b8e9a28a85a1b144ec0dc9717cc:
     remote: fix race on download error. Fixes #5047
   + 3842bd39e10612c7eef36c6048407e81bcd0a8fb:
     jdk: use parallel old gc and disable compact strings

Incompatible changes:

  - The $(ANDROID_CPU) Make variable is not available anymore. Use
    $(TARGET_CPU) after an Android configuration transition instead.
  - The $(JAVA_TRANSLATIONS) Make variable is not supported anymore.
  - Skylark structs (using struct()) may no longer have to_json and
    to_proto overridden.
  - The mobile-install --skylark_incremental_res flag is no longer
    available, use the --skylark flag instead.

New features:

  - android_local_test now takes advantage of Robolectric's binary
    resource processing which allows for faster tests.
  - Allow @ in package names.

Important changes:

  - Option --glibc is removed, toolchain selection relies solely on
    --cpu and --compiler options.
  - Build support for enabling cross binary FDO optimization.
  - The --distdir option is no longer experimental. This
      option allows to specify additional directories to look for
      files before trying to fetch them from the network. Files from
      any of the distdirs are only used if a checksum for the file
      is specified and both, the filename and the checksum, match.
  - Java coverage works now with multiple jobs.
  - Flip default value of --experimental_shortened_obj_file_path to
    true, Bazel now generates short object file path by default.
  - New rules for importing Android dependencies:
    `aar_import_external` and `aar_maven_import_external`.
    `aar_import_external` enables specifying external AAR
    dependencies using a list of HTTP URLs for the artifact.
    `aar_maven_import_external` enables specifying external AAR
    dependencies using the artifact coordinate and a list of server
    URLs.
  - The BAZEL_JAVAC_OPTS environment variable allows arguments, e.g.,
    "-J-Xmx2g", may be passed to the javac compiler during bootstrap
    build. This is helpful if your system chooses too small of a max
    heap size for the Java compiler during the bootstrap build.
  - --noexpand_configs_in_place is deprecated.
  - A tool to parse the Bazel execution log.
  - Support for LIPO has been fully removed.
  - Remove support for --discard_actions_after_execution.
  - Add --materialize_param_files flag to write parameter files even
    when actions are executed remotely.
  - Windows default system bazelrc is read from the user's
    ProgramData if present.
  - --[no]allow_undefined_configs no longer exists, passing undefined
    configs is an error.
  - In remote caching we limit the number of open
    TCP connections to 100 by default. The number can be adjusted
    by specifying the --remote_max_connections flag.

## Build informations
   - [Commit](https://github.com/bazelbuild/bazel/commit/fb9215a)
Uncompressing.......

Bazel is now installed!

Make sure you have "/usr/local/bin" in your path. You can also activate bash
completion by adding the following line to your ~/.bashrc:
  source /usr/local/lib/bazel/bin/bazel-complete.bash

See http://bazel.build/docs/getting-started.html to start a new project!

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
安装DeepRec,可以按照以下步骤进行操作: 1. 首先,使用以下命令下载DeepRec的Docker镜像:docker pull alideeprec/deeprec-release:deeprec2304-cpu-py38-ubuntu20.04 2. 接下来,使用以下命令为镜像打上公司镜像仓库标签:docker image tag alideeprec/deeprec-release:deeprec2304-cpu-py38-ubuntu20.04 company/search_rec/deeprec-dev-cpu-py38-ubuntu20.04 3. 然后,登录到公司镜像仓库:docker login company.com 4. 使用以下命令将镜像推送到公司镜像仓库:docker push company/deeprec-dev-cpu-py38-ubuntu20.04 5. 下载DeepRec的源代码,并切换到相应的分支:git clone https://github.com/DeepRec-AI/DeepRec.git && cd DeepRec/ && git checkout deeprec2304 6. 运行以下命令进入DeepRec的Docker容器:docker run --net host -it alideeprec/deeprec-build:deeprec-dev-cpu-py36-ubuntu18.04 7. 在容器内进行编译,使用以下命令:./configure && bazel build -c opt --config=opt //tensorflow/tools/pip_package:build_pip_package 8. 可能会遇到缺少aclocal的错误,需要安装automake,使用以下命令:apt-get install automake 9. 完成编译后,您可以从相应的位置下载所需的数据文件,如:wget https://storage.googleapis.com/dataset-uploader/criteo-kaggle/large_version/train.csv 和 wget https://storage.googleapis.com/dataset-uploader/criteo-kaggle/large_version/eval.csv 综上所述,您可以按照以上步骤安装DeepRec并开始使用它。请注意,某些步骤可能需要一些时间和依赖项的安装。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* *3* [deeprec编译](https://blog.csdn.net/weixin_40548136/article/details/131726720)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"] [ .reference_list ]
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值