Skip to content

Commit

Permalink
ci: Add R build into release job (h2oai#1531)
Browse files Browse the repository at this point in the history
  • Loading branch information
mturoci authored Jul 15, 2022
1 parent d53ee01 commit 452affd
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 24 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/release-wave-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ jobs:
- name: Setup
run: make setup

- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
working-directory: ./r

- name: Unit Test
run: make test-ui-ci

Expand All @@ -65,6 +70,7 @@ jobs:
py/dist/h2o_wave-${{ env.VERSION }}-py3-none-manylinux1_x86_64.whl
py/dist/h2o_wave-${{ env.VERSION }}-py3-none-win_amd64.whl
py/dist/h2o_wave-${{ env.VERSION }}-py3-none-any.whl
r/build/h2owave_nightly_R.tar.gz
tag_name: ${{ env.TAG }}
prerelease: true
env:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/release-wave.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ jobs:
- name: Setup
run: make setup

- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
working-directory: ./r

- name: Unit Test
run: make test-ui-ci

Expand Down Expand Up @@ -56,6 +61,7 @@ jobs:
py/dist/h2o_wave-${{ env.VERSION }}-py3-none-manylinux1_x86_64.whl
py/dist/h2o_wave-${{ env.VERSION }}-py3-none-win_amd64.whl
py/dist/h2o_wave-${{ env.VERSION }}-py3-none-any.whl
r/build/h2owave_${{ env.VERSION }}_R.tar.gz
tag_name: ${{ env.TAG }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ build-ide: ## Build IDE
rm -rf ui/build/_ide
mv ide/dist ui/build/_ide

build-r: ## Build R client.
cd r && $(MAKE) build

build-r-nightly: ## Build nightly R client.
cd r && $(MAKE) build-nightly

build-apps: ## Prepare apps for HAC upload.
mkdir -p py/tmp
for app in py/apps/*; do mkdir -p build/apps/wave-`basename $$app`; done
Expand Down Expand Up @@ -135,17 +141,20 @@ release: build-ui ## Prepare release builds (e.g. "VERSION=1.2.3 make release)"
$(MAKE) OS=windows ARCH=amd64 EXE_EXT=".exe" release-os
$(MAKE) website
$(MAKE) build-py
$(MAKE) build-r

release-nightly: build-ui ## Prepare nightly release builds.
$(MAKE) OS=linux ARCH=amd64 release-os
$(MAKE) OS=darwin ARCH=amd64 release-os
$(MAKE) OS=darwin ARCH=arm64 release-os
$(MAKE) OS=windows ARCH=amd64 EXE_EXT=".exe" release-os
$(MAKE) build-py
$(MAKE) build-r-nightly

publish-release-s3:
aws s3 sync build/ s3://h2o-wave/releases --acl public-read --exclude "*" --include "*.tar.gz"
aws s3 sync py/dist/ s3://h2o-wave/releases --acl public-read --exclude "*" --include "*.whl"
aws s3 sync r/build/ s3://h2o-wave/releases --acl public-read --exclude "*" --include "*.tar.gz"

publish-apps-s3:
for app in build/apps/*; do aws s3 sync $$app $(MC_S3_BUCKET)/`basename $$app`; done
Expand Down
1 change: 1 addition & 0 deletions r/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build
10 changes: 7 additions & 3 deletions r/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: h2owave
Title: R Driver for H2O Wave Realtime Apps Framework
Version: 0.18.2
Version: 0.22.0
Date: 2022-05-03
Authors@R: c(
person(given = "Ashrith",
Expand All @@ -10,7 +10,11 @@ Authors@R: c(
person(given = "Prithvi",
family = "Prabhu",
role = c("aut"),
email = "[email protected]")
email = "[email protected]"),
person(given = "Martin",
family = "Turoci",
role = c("ctb"),
email = "[email protected]")
)
Description: H2O Wave is a lightweight software stack for programming interactive web applications entirely in R (no HTML/Javascript/CSS) required. It is designed to make it fast, fun and easy to build low-latency, realtime, collaborative, web-based applications. It ships batteries-included with a suite of form and data visualization components for rapidly prototyping analytical and decision-support applications. Wave’s components work in conjunction with the Wave relay server that facilitates realtime state synchronization between R and web browsers.
License: Apache License (>= 2.0)
Expand All @@ -27,4 +31,4 @@ Depends:
httpuv,
R6(>= 2.0)
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.2
RoxygenNote: 7.2.0
25 changes: 17 additions & 8 deletions r/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
#base rdriver image
FROM opsh2oai/rdriver:latest
FROM r-base:latest

# clone our library, note that this might be cached so run docker with --no-cache if you have done
# changes to repo
RUN git clone --depth 1 https://github.com/h2oai/wave
COPY ../ /wave

# step 6! clone our library, note that this might be cached so run docker with --no-cache if you have done
# changes to repo
RUN git clone --depth 1 https://github.com/h2oai/wave
WORKDIR /wave

RUN apt-get update -q && apt-get -y install libcurl4-openssl-dev \
libxml2-dev \
wget \
curl \
git \
gdebi-core \
r-base-dev \
r-cran-openssl \
r-cran-xml2 \
r-cran-curl \
r-cran-httr \
r-cran-httpuv

# mek me a package, please!
# if this runs fine then the dependencies have been installed and package will be ready in wave directory in docker
RUN cd wave/r/ && make package
RUN make build
33 changes: 21 additions & 12 deletions r/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PKG_VERSION=$(shell grep -i ^version DESCRIPTION | cut -d : -d \ -f 2)
VERSION=$(shell grep -i ^version DESCRIPTION | cut -d : -d \ -f 2)
PKG_NAME=$(shell grep -i ^package DESCRIPTION | cut -d : -d \ -f 2)

R_FILES := $(wildcard R/*.R)
Expand All @@ -12,16 +12,26 @@ SED=$(shell command -v gsed || command -v sed)

all: clean preinstall doc package install

package: preinstall doc $(PKG_NAME)_$(PKG_VERSION).tar.gz
$(PKG_NAME)_$(PKG_VERSION).tar.gz: $(PKG_FILES)
build: preinstall doc
R CMD build .
rm -rf build
mkdir build
mv man build
mv NAMESPACE build
mv $(PKG_NAME)_$(VERSION).tar.gz build/$(PKG_NAME)_$(VERSION)_R.tar.gz

package0: doc $(PKG_NAME)_$(PKG_VERSION).tar.gz
$(PKG_NAME)_$(PKG_VERSION).tar.gz: $(PKG_FILES)
build-nightly: preinstall
R CMD build .
rm -rf build
mkdir build
mv $(PKG_NAME)_$(VERSION).tar.gz build/$(PKG_NAME)_nightly_R.tar.gz

check: $(PKG_NAME)_$(PKG_VERSION).tar.gz
R CMD check $(PKG_NAME)_$(PKG_VERSION).tar.gz
package0: doc $(PKG_NAME)_$(VERSION).tar.gz
$(PKG_NAME)_$(VERSION).tar.gz: $(PKG_FILES)
R CMD build .

check: $(PKG_NAME)_$(VERSION).tar.gz
R CMD check $(PKG_NAME)_$(VERSION).tar.gz

doc:
Rscript -e '.libPaths(c("~/R_LIBS",.libPaths()));library(devtools);library(roxygen2);document()'
Expand All @@ -31,21 +41,20 @@ preinstall:
R -e 'install.packages(c("roxygen2","devtools","httr","stringr"), repos="http://cran.us.r-project.org")'

install:
R CMD INSTALL $(PKG_NAME)_$(PKG_VERSION).tar.gz
R CMD INSTALL $(PKG_NAME)_$(VERSION).tar.gz

uninstall: $(PKG_NAME)_$(PKG_VERSION).tar.gz
uninstall: $(PKG_NAME)_$(VERSION).tar.gz
R CMD REMOVE $(PKG_NAME)

.PHONY: tag
tag: # Bump version
$(SED) -i -r -e "s/Version.+/Version: $(VERSION)/" DESCRIPTION

uninstall: $(PKG_NAME)_$(PKG_VERSION).tar.gz
uninstall: $(PKG_NAME)_$(VERSION).tar.gz
R CMD REMOVE $(PKG_NAME)

clean:
-rm -f $(PKG_NAME)_*.tar.gz
-rm -r -f $(PKG_NAME).Rcheck
-rm -f NAMESPACE
-rm -rf man
-rm -f build

5 changes: 4 additions & 1 deletion website/src/components/downloads.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const Downloads = () => {
setItems([
files.filter(({ Key }) => Key.endsWith('.gz') && Key.includes('wave-')).reverse(),
files.filter(({ Key }) => Key.endsWith('.whl') && Key.includes('wave-')).reverse(),
files.filter(({ Key }) => Key.endsWith('.gz') && Key.includes('_R')).reverse(),
files.filter(({ Key }) => Key.endsWith('.gz') && Key.includes('wavedb-')).reverse()
])
}
Expand All @@ -27,8 +28,10 @@ export const Downloads = () => {
{items[0].map(mapToLink)}
<h4>Python client</h4>
{items[1].map(mapToLink)}
<h4>WaveDB</h4>
<h4>R client</h4>
{items[2].map(mapToLink)}
<h4>WaveDB</h4>
{items[3].map(mapToLink)}
</>
)
: 'Loading...'
Expand Down

0 comments on commit 452affd

Please sign in to comment.