Skip to content

Commit

Permalink
New Website: New Pipeline [3/3] (apache#15883)
Browse files Browse the repository at this point in the history
Merging new website pipelines and fix to content
  • Loading branch information
ThomasDelteil authored and larroy committed Sep 28, 2019
1 parent 1e50844 commit 840a599
Show file tree
Hide file tree
Showing 120 changed files with 5,269 additions and 1,744 deletions.
20 changes: 5 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ ifeq ($(USE_DIST_KVSTORE), 1)
LDFLAGS += $(PS_LDFLAGS_A)
endif

.PHONY: clean all extra-packages test lint docs clean_all rcpplint rcppexport roxygen\
.PHONY: clean all extra-packages test lint clean_all rcpplint rcppexport roxygen\
cython2 cython3 cython cyclean

all: lib/libmxnet.a lib/libmxnet.so $(BIN) extra-packages sample_lib
Expand Down Expand Up @@ -664,20 +664,6 @@ cpplint:
pylint:
python3 -m pylint --rcfile=$(ROOTDIR)/ci/other/pylintrc --ignore-patterns=".*\.so$$,.*\.dll$$,.*\.dylib$$" python/mxnet tools/caffe_converter/*.py

sample_lib:
$(CXX) -shared -fPIC example/lib_api/mylib.cc -o libsample_lib.so -I include/mxnet

doc: docs

docs:
make -C docs html

clean_docs:
make -C docs clean

doxygen:
doxygen docs/Doxyfile

# Cython build
cython:
cd python; $(PYTHON) setup.py build_ext --inplace --with-cython
Expand Down Expand Up @@ -727,6 +713,10 @@ rpkgtest:
Rscript -e 'require(testthat);res<-test_dir("R-package/tests/testthat");if(!testthat:::all_passed(res)){stop("Test failures", call. = FALSE)}'
Rscript -e 'res<-covr:::package_coverage("R-package");fileConn<-file(paste("r-package_coverage_",toString(runif(1)),".json"));writeLines(covr:::to_codecov(res), fileConn);close(fileConn)'


sample_lib:
$(CXX) -shared -fPIC example/lib_api/mylib.cc -o libsample_lib.so -I include/mxnet

scalaclean:
(cd $(ROOTDIR)/scala-package && mvn clean)

Expand Down
1 change: 1 addition & 0 deletions R-package/DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ Depends:
LinkingTo: Rcpp
VignetteBuilder: knitr
RoxygenNote: 6.1.1
Encoding: UTF-8
13 changes: 13 additions & 0 deletions R-package/src/export.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ std::string ExportDocString(const std::string& docstring) {
return os.str();
}

std::string ReplaceAll(std::string str, const std::string& from, const std::string& to) {
size_t start_pos = 0;
while ((start_pos = str.find(from, start_pos)) != std::string::npos) {
str.replace(start_pos, from.length(), to);
start_pos += to.length(); // Handles case where 'to' is a substring of 'from'
}
return str;
}

void ExportVArgFunction(std::ostream& os, // NOLINT(*)
const std::string& func_name,
const std::string& docstr) {
Expand Down Expand Up @@ -118,6 +127,10 @@ void Exporter::Export(const std::string& path) {
|| fname == "mx.varg.symbol.min") continue;
Rcpp::List func_info(scope->get_function(fname));
std::string docstr = Rcpp::as<std::string>(func_info[2]);

docstr = ReplaceAll(docstr, std::string("\a"), std::string("\\a"));
docstr = ReplaceAll(docstr, std::string("\b"), std::string("\\b"));

if (docstr.find("@export") == std::string::npos) continue;
if (fname.find("mx.varg.") == 0) {
ExportVArgFunction(script, fname, docstr);
Expand Down
24 changes: 12 additions & 12 deletions ci/Jenkinsfile_utils.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def pack_lib(name, libs, include_gcov_data = false) {
sh returnStatus: true, script: """
set +e
echo "Packing ${libs} into ${name}"
for i in \$(echo ${libs} | sed -e 's/,/ /g'); do md5sum \$i; done
for i in \$(echo ${libs} | sed -e 's/,/ /g'); do md5sum \$i; ls -lh \$i; done
return 0
"""
stash includes: libs, name: name
Expand Down Expand Up @@ -114,7 +114,7 @@ def get_git_commit_hash() {
def publish_test_coverage() {
// CodeCovs auto detection has trouble with our CIs PR validation due the merging strategy
git_commit_hash = get_git_commit_hash()

if (env.CHANGE_ID) {
// PR execution
codecovArgs = "-B ${env.CHANGE_TARGET} -C ${git_commit_hash} -P ${env.CHANGE_ID}"
Expand Down Expand Up @@ -168,9 +168,9 @@ def get_repo_url() {
def update_github_commit_status(state, message) {
node(NODE_UTILITY) {
// NOTE: https://issues.jenkins-ci.org/browse/JENKINS-39482
//The GitHubCommitStatusSetter requires that the Git Server is defined under
//*Manage Jenkins > Configure System > GitHub > GitHub Servers*.
//Otherwise the GitHubCommitStatusSetter is not able to resolve the repository name
//The GitHubCommitStatusSetter requires that the Git Server is defined under
//*Manage Jenkins > Configure System > GitHub > GitHub Servers*.
//Otherwise the GitHubCommitStatusSetter is not able to resolve the repository name
//properly and you would see an empty list of repos:
//[Set GitHub commit status (universal)] PENDING on repos [] (sha:xxxxxxx) with context:test/mycontext
//See https://cwiki.apache.org/confluence/display/MXNET/Troubleshooting#Troubleshooting-GitHubcommit/PRstatusdoesnotgetpublished
Expand All @@ -182,7 +182,7 @@ def update_github_commit_status(state, message) {

commitSha = get_git_commit_hash()
echo "commitSha=${commitSha}"

context = get_github_context()
echo "context=${context}"

Expand Down Expand Up @@ -216,29 +216,29 @@ def update_github_commit_status(state, message) {
def get_github_context() {
// Since we use multi-branch pipelines, Jenkins appends the branch name to the job name
if (env.BRANCH_NAME) {
short_job_name = JOB_NAME.substring(0, JOB_NAME.lastIndexOf('/'))
short_job_name = JOB_NAME.substring(0, JOB_NAME.lastIndexOf('/'))
} else {
short_job_name = JOB_NAME
}

return "ci/jenkins/${short_job_name}"
}

def parallel_stage(stage_name, steps) {
// Allow to pass an array of steps that will be executed in parallel in a stage
new_map = [:]

for (def step in steps) {
new_map = new_map << step
}

stage(stage_name) {
parallel new_map
}
}

def assign_node_labels(args) {
// This function allows to assign instance labels to the generalized placeholders.
// This function allows to assign instance labels to the generalized placeholders.
// This serves two purposes:
// 1. Allow generalized placeholders (e.g. NODE_WINDOWS_CPU) in the job definition
// in order to abstract away the underlying node label. This allows to schedule a job
Expand All @@ -263,7 +263,7 @@ def main_wrapper(args) {
// args:
// - core_logic: Jenkins pipeline containing core execution logic
// - failure_handler: Failure handler

// assign any caught errors here
err = null
try {
Expand Down
1 change: 1 addition & 0 deletions ci/docker/Dockerfile.build.test.arm_qemu
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ WORKDIR /work

RUN apt-get update
COPY install/ubuntu_python.sh /work/
COPY install/requirements /work/
RUN /work/ubuntu_python.sh

COPY install/ubuntu_arm_qemu.sh /work
Expand Down
1 change: 1 addition & 0 deletions ci/docker/Dockerfile.build.ubuntu_blc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ WORKDIR /work/deps
COPY install/ubuntu_core.sh /work/
RUN /work/ubuntu_core.sh
COPY install/ubuntu_python.sh /work/
COPY install/requirements /work/
RUN /work/ubuntu_python.sh
COPY install/ubuntu_npm_blc.sh /work/
RUN /work/ubuntu_npm_blc.sh
Expand Down
1 change: 1 addition & 0 deletions ci/docker/Dockerfile.build.ubuntu_build_cuda
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ RUN /work/ubuntu_core.sh
COPY install/deb_ubuntu_ccache.sh /work/
RUN /work/deb_ubuntu_ccache.sh
COPY install/ubuntu_python.sh /work/
COPY install/requirements /work/
RUN /work/ubuntu_python.sh
COPY install/ubuntu_scala.sh /work/
COPY install/sbt.gpg /work/
Expand Down
2 changes: 1 addition & 1 deletion ci/docker/Dockerfile.build.ubuntu_cpu
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ COPY install/deb_ubuntu_ccache.sh /work/
RUN /work/deb_ubuntu_ccache.sh

COPY install/ubuntu_python.sh /work/
COPY install/requirements /work/
RUN /work/ubuntu_python.sh

COPY install/ubuntu_scala.sh /work/
Expand Down Expand Up @@ -67,7 +68,6 @@ COPY install/ubuntu_onnx.sh /work/
RUN /work/ubuntu_onnx.sh

COPY install/ubuntu_docs.sh /work/
COPY install/docs_requirements /work/
RUN /work/ubuntu_docs.sh

# Always last
Expand Down
31 changes: 16 additions & 15 deletions docs/api/r/Makefile → ci/docker/Dockerfile.build.ubuntu_cpu_c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- mode: dockerfile -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
Expand All @@ -14,21 +15,21 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# Dockerfile to build and run MXNet on Ubuntu 16.04 for CPU

FROM ubuntu:16.04

WORKDIR /work/deps

COPY install/ubuntu_core.sh /work/
RUN /work/ubuntu_core.sh

COPY install/deb_ubuntu_ccache.sh /work/
RUN /work/deb_ubuntu_ccache.sh

# This is the makefile for compiling Rmarkdown files into the md file with results.
PKGROOT=../../R-package
RUN apt-get update && apt-get install -y doxygen graphviz

# ADD The Markdown to be built here, with suffix md
classifyRealImageWithPretrainedModel.md:
mnistCompetition.md:
ndarrayAndSymbolTutorial.md:
fiveMinutesNeuralNetwork.md:
COPY runtime_functions.sh /work/

# General Rules for build rmarkdowns, need knitr
%.md: $(PKGROOT)/vignettes/%.Rmd
rm -rf "../../web-data/mxnet/knitr/$(basename $@)-"*;
Rscript -e \
"require(knitr);"\
"knitr::opts_knit\$$set(root.dir=\".\");"\
"knitr::opts_chunk\$$set(fig.path=\"../../web-data/mxnet/knitr/$(basename $@)-\");"\
"knitr::knit(\"$+\")"
WORKDIR /work/mxnet
68 changes: 68 additions & 0 deletions ci/docker/Dockerfile.build.ubuntu_cpu_jekyll
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# -*- mode: dockerfile -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# Dockerfile to build and run MXNet on Ubuntu 16.04 for CPU

FROM ubuntu:16.04

WORKDIR /work/deps

SHELL ["/bin/bash", "-l", "-c" ]

RUN apt-get update && apt-get install -y \
build-essential \
git \
zlib1g-dev \
gnupg2 \
curl

# Always last, except here to prevent conflicts with rvm
ARG USER_ID=0
ARG GROUP_ID=0
COPY install/ubuntu_adduser.sh /work/
RUN /work/ubuntu_adduser.sh

RUN curl -sSL https://rvm.io/mpapis.asc | gpg2 --import - && \
curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import - && \
curl -sSL https://get.rvm.io | bash -s stable

RUN source /etc/profile.d/rvm.sh && \
rvm requirements && \
rvm install 2.6 && \
rvm use 2.6.3 --default

ENV BUNDLE_HOME=/work/deps/bundle
ENV BUNDLE_APP_CONFIG=/work/deps/bundle
ENV BUNDLE_BIN=/work/deps/bundle/bin
ENV GEM_BIN=/work/deps/gem/bin
ENV GEM_HOME=/work/deps/gem

RUN echo "gem: --no-ri --no-rdoc" > ~/.gemrc
RUN yes | gem update --system
RUN yes | gem install --force bundler
RUN gem install jekyll

ENV PATH=$BUNDLE_BIN:$GEM_BIN:$PATH

COPY runtime_functions.sh /work/

RUN chown -R jenkins_slave /work/ && \
chown -R jenkins_slave /usr/local/bin && \
chown -R jenkins_slave /usr/local/rvm

WORKDIR /work/mxnet
81 changes: 81 additions & 0 deletions ci/docker/Dockerfile.build.ubuntu_cpu_julia
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# -*- mode: dockerfile -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# Dockerfile to build and run MXNet on Ubuntu 16.04 for CPU

FROM ubuntu:16.04

WORKDIR /work/deps

COPY install/ubuntu_core.sh /work/
RUN /work/ubuntu_core.sh

COPY install/deb_ubuntu_ccache.sh /work/
RUN /work/deb_ubuntu_ccache.sh

COPY install/ubuntu_python.sh /work/
COPY install/requirements /work/
RUN /work/ubuntu_python.sh

COPY install/ubuntu_scala.sh /work/
COPY install/sbt.gpg /work/
RUN /work/ubuntu_scala.sh

COPY install/ubuntu_clojure.sh /work/
RUN /work/ubuntu_clojure.sh

COPY install/ubuntu_r.sh /work/
COPY install/r.gpg /work/
RUN /work/ubuntu_r.sh

COPY install/ubuntu_perl.sh /work/
RUN /work/ubuntu_perl.sh

COPY install/ubuntu_julia.sh /work/
RUN /work/ubuntu_julia.sh

COPY install/ubuntu_clang.sh /work/
RUN /work/ubuntu_clang.sh

COPY install/ubuntu_gcc8.sh /work/
RUN /work/ubuntu_gcc8.sh

COPY install/ubuntu_mkl.sh /work/
RUN /work/ubuntu_mkl.sh

COPY install/ubuntu_mklml.sh /work/
RUN /work/ubuntu_mklml.sh

COPY install/ubuntu_caffe.sh /work/
RUN /work/ubuntu_caffe.sh

COPY install/ubuntu_onnx.sh /work/
RUN /work/ubuntu_onnx.sh

COPY install/ubuntu_docs.sh /work/
RUN /work/ubuntu_docs.sh

# Always last
ARG USER_ID=0
ARG GROUP_ID=0
COPY install/ubuntu_adduser.sh /work/
RUN /work/ubuntu_adduser.sh

COPY runtime_functions.sh /work/

WORKDIR /work/mxnet
Loading

0 comments on commit 840a599

Please sign in to comment.