Skip to content

Commit

Permalink
(core) updates from grist-core
Browse files Browse the repository at this point in the history
  • Loading branch information
paulfitz committed Nov 20, 2024
2 parents 7bd30c4 + 1c26dd7 commit a205b9a
Show file tree
Hide file tree
Showing 13 changed files with 117 additions and 34 deletions.
31 changes: 29 additions & 2 deletions .github/workflows/docker_latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,36 @@ jobs:
- name: Install Google Chrome for Testing
run: ./test/test_env.sh node_modules/selenium-webdriver/bin/linux/selenium-manager

- name: Run tests
- name: Run tests with default settings
if: ${{ !inputs.disable_tests }}
run: TEST_IMAGE=${{ env.DOCKER_HUB_OWNER }}/${{ matrix.image.name }}:${{ env.TAG }} VERBOSE=1 DEBUG=1 MOCHA_WEBDRIVER_HEADLESS=1 yarn run test:docker
run: |
export TEST_IMAGE=${{ env.DOCKER_HUB_OWNER }}/${{ matrix.image.name }}:${{ env.TAG }}
export VERBOSE=1
export DEBUG=1
export MOCHA_WEBDRIVER_HEADLESS=1
yarn run test:docker
- name: Run some tests with gvisor and python2
if: ${{ !inputs.disable_tests }}
run: |
export TEST_IMAGE=${{ env.DOCKER_HUB_OWNER }}/${{ matrix.image.name }}:${{ env.TAG }}
export VERBOSE=1
export DEBUG=1
export MOCHA_WEBDRIVER_HEADLESS=1
export GREP_TESTS='should support basic editing'
export TEST_DOCKER_OPTIONS='-e GRIST_SANDBOX_FLAVOR=gvisor -e PYTHON_VERSION_ON_CREATION=2'
yarn run test:docker
- name: Run some tests with gvisor and python3
if: ${{ !inputs.disable_tests }}
run: |
export TEST_IMAGE=${{ env.DOCKER_HUB_OWNER }}/${{ matrix.image.name }}:${{ env.TAG }}
export VERBOSE=1
export DEBUG=1
export MOCHA_WEBDRIVER_HEADLESS=1
export GREP_TESTS='should support basic editing'
export TEST_DOCKER_OPTIONS='-e GRIST_SANDBOX_FLAVOR=gvisor -e PYTHON_VERSION_ON_CREATION=3'
yarn run test:docker
- name: Re-enable the ext/ directory
if: ${{ !inputs.disable_tests }}
Expand Down
31 changes: 24 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ FROM scratch AS ext
## Javascript build stage
################################################################################

FROM node:18-buster AS builder
FROM node:22-bookworm AS builder

# Install all node dependencies.
WORKDIR /grist
Expand Down Expand Up @@ -46,7 +46,7 @@ RUN \
################################################################################

# Fetch python3.11
FROM python:3.11-slim-buster AS collector-py3
FROM python:3.11-slim-bookworm AS collector-py3
ADD sandbox/requirements3.txt requirements3.txt
RUN \
pip3 install -r requirements3.txt
Expand All @@ -59,15 +59,22 @@ RUN \
# the workarounds needed to keep it are getting silly.
# It doesn't exist in recent Debian, so we need to reach back
# to buster.
# Many Python2 imports require the ffi foreign-function interface
# library binary, of course present on modern debian but with
# a different ABI (currently version 8, versus version 6 for this
# version of Python2). We move it from an achitecture-specific location
# to a standard location so we can pick it up and copy it across later.
# This will no longer be necessary when support for Python2 is dropped.
# The Grist data engine code will not work without it.
FROM debian:buster-slim AS collector-py2
ADD sandbox/requirements.txt requirements.txt
RUN \
apt update && \
apt install -y --no-install-recommends python2 python-pip python-setuptools \
build-essential libxml2-dev libxslt-dev python-dev zlib1g-dev && \
pip2 install wheel && \
pip2 install -r requirements.txt

pip2 install -r requirements.txt && \
find /usr/lib -iname "libffi.so.6*" -exec cp {} /usr/local/lib \;

################################################################################
## Sandbox collection stage
Expand All @@ -76,16 +83,19 @@ RUN \
# Fetch gvisor-based sandbox. Note, to enable it to run within default
# unprivileged docker, layers of protection that require privilege have
# been stripped away, see https://github.com/google/gvisor/issues/4371
# The sandbox binary is built on buster, but remains compatible with recent
# Debian.
# The standalone sandbox binary is built on buster, but remains compatible
# with recent Debian.
# If you'd like to use unmodified gvisor, you should be able to just drop
# in the standard runsc binary and run the container with any extra permissions
# it needs.
FROM docker.io/gristlabs/gvisor-unprivileged:buster AS sandbox

################################################################################
## Run-time stage
################################################################################

# Now, start preparing final image.
FROM node:18-buster-slim
FROM node:22-bookworm-slim

# Install libexpat1, libsqlite3-0 for python3 library binary dependencies.
# Install pgrep for managing gvisor processes.
Expand Down Expand Up @@ -163,6 +173,12 @@ WORKDIR /grist
# settings, you can get sandboxing as follows:
# docker run --env GRIST_SANDBOX_FLAVOR=gvisor -p 8484:8484 -it <image>
#
# "NODE_OPTIONS=--no-deprecation" is set because there is a punycode
# deprecation nag that is relevant to developers but not to users.
# TODO: upgrade package.json to avoid using all package versions
# using the punycode functionality that may be removed in future
# versions of node.
#
ENV \
PYTHON_VERSION_ON_CREATION=3 \
GRIST_ORG_IN_PATH=true \
Expand All @@ -174,6 +190,7 @@ ENV \
GRIST_SESSION_COOKIE=grist_core \
GVISOR_FLAGS="-unprivileged -ignore-cgroups" \
GRIST_SANDBOX_FLAVOR=unsandboxed \
NODE_OPTIONS="--no-deprecation" \
TYPEORM_DATABASE=/persist/home.sqlite3

EXPOSE 8484
Expand Down
1 change: 1 addition & 0 deletions app/client/ui/PagePanels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ const cssLeftPaneHeader = styled(cssHeader, `
`);
const cssRightPaneHeader = styled(cssHeader, `
background-color: ${theme.rightPanelBg};
border-bottom: 0;
`);
const cssBottomFooter = styled ('div', `
height: ${bottomFooterHeightPx}px;
Expand Down
22 changes: 18 additions & 4 deletions app/client/ui/RightPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1182,21 +1182,35 @@ const cssTopBarItem = styled('div', `
flex: 1 1 0px;
height: 100%;
background-color: ${theme.rightPanelTabBg};
font-weight: ${vars.headerControlTextWeight};
border-right: 1px solid ${theme.rightPanelTabBg};
border-left: 1px solid ${theme.rightPanelTabBg};
border-bottom: 1px solid ${theme.rightPanelTabBorder};
font-weight: initial;
color: ${theme.rightPanelTabFg};
--icon-color: ${theme.rightPanelTabIcon};
display: flex;
align-items: center;
cursor: default;
&:first-child {
border-left: 0;
}
&:last-child {
border-right: 0;
}
&-selected {
background-color: ${theme.rightPanelTabSelectedBg};
font-weight: initial;
font-weight: ${vars.headerControlTextWeight};
color: ${theme.rightPanelTabSelectedFg};
--icon-color: ${theme.rightPanelTabSelectedFg};
--icon-color: ${theme.rightPanelTabSelectedIcon};
border-bottom-color: ${theme.rightPanelTabSelectedBg};
border-left-color: ${theme.rightPanelTabBorder};
border-right-color: ${theme.rightPanelTabBorder};
}
&:not(&-selected):hover {
background-color: ${theme.rightPanelTabHoverBg};
border-left-color: ${theme.rightPanelTabHoverBg};
border-right-color: ${theme.rightPanelTabHoverBg};
color: ${theme.rightPanelTabHoverFg};
--icon-color: ${theme.rightPanelTabIconHover};
}
`);
Expand Down
15 changes: 9 additions & 6 deletions app/client/ui2018/cssVars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,16 +436,19 @@ export const theme = {
colors.darkGrey),

/* Right Panel */
rightPanelTabFg: new CustomProp('theme-right-panel-tab-fg', undefined, colors.dark),
rightPanelTabBg: new CustomProp('theme-right-panel-tab-bg', undefined, colors.lightGrey),
rightPanelTabFg: new CustomProp('theme-right-panel-tab-fg', undefined, colors.slate),
rightPanelTabBg: new CustomProp('theme-right-panel-tab-bg', undefined, colors.light),
rightPanelTabIcon: new CustomProp('theme-right-panel-tab-icon', undefined, colors.slate),
rightPanelTabIconHover: new CustomProp('theme-right-panel-tab-icon-hover', undefined,
colors.lightGreen),
rightPanelTabHoverBg: new CustomProp('theme-right-panel-tab-hover-bg', undefined,
colors.mediumGrey),
colors.dark),
rightPanelTabBorder: new CustomProp('theme-right-panel-tab-border', undefined, colors.mediumGrey),
rightPanelTabHoverBg: new CustomProp('theme-right-panel-tab-hover-bg', undefined, colors.light),
rightPanelTabHoverFg: new CustomProp('theme-right-panel-tab-hover-fg', undefined, colors.dark),
rightPanelTabSelectedFg: new CustomProp('theme-right-panel-tab-selected-fg', undefined,
colors.light),
colors.dark),
rightPanelTabSelectedBg: new CustomProp('theme-right-panel-tab-selected-bg', undefined,
colors.lightGrey),
rightPanelTabSelectedIcon: new CustomProp('theme-right-panel-tab-selected-icon', undefined,
colors.lightGreen),
rightPanelTabButtonHoverBg: new CustomProp('theme-right-panel-tab-button-hover-bg',
undefined, colors.darkGreen),
Expand Down
3 changes: 3 additions & 0 deletions app/common/ThemePrefs-ti.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,12 @@ export const ThemeColors = t.iface([], {
"right-panel-tab-bg": "string",
"right-panel-tab-icon": "string",
"right-panel-tab-icon-hover": "string",
"right-panel-tab-border": "string",
"right-panel-tab-hover-bg": "string",
"right-panel-tab-hover-fg": "string",
"right-panel-tab-selected-fg": "string",
"right-panel-tab-selected-bg": "string",
"right-panel-tab-selected-icon": "string",
"right-panel-tab-button-hover-bg": "string",
"right-panel-subtab-fg": "string",
"right-panel-subtab-selected-fg": "string",
Expand Down
3 changes: 3 additions & 0 deletions app/common/ThemePrefs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,12 @@ export interface ThemeColors {
'right-panel-tab-bg': string;
'right-panel-tab-icon': string;
'right-panel-tab-icon-hover': string;
'right-panel-tab-border': string;
'right-panel-tab-hover-bg': string;
'right-panel-tab-hover-fg': string;
'right-panel-tab-selected-fg': string;
'right-panel-tab-selected-bg': string;
'right-panel-tab-selected-icon': string;
'right-panel-tab-button-hover-bg': string;
'right-panel-subtab-fg': string;
'right-panel-subtab-selected-fg': string;
Expand Down
15 changes: 9 additions & 6 deletions app/common/themes/GristDark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,16 @@ export const GristDark: ThemeColors = {
'left-panel-page-emoji-outline': '#70707D',

/* Right Panel */
'right-panel-tab-fg': '#EFEFEF',
'right-panel-tab-bg': '#262633',
'right-panel-tab-fg': '#A4A4B1',
'right-panel-tab-bg': '#32323f',
'right-panel-tab-icon': '#A4A4B1',
'right-panel-tab-icon-hover': '#13D78D',
'right-panel-tab-hover-bg': 'rgba(111,111,117,0.6)',
'right-panel-tab-selected-fg': '#FFFFFF',
'right-panel-tab-selected-bg': '#157A54',
'right-panel-tab-icon-hover': '#EFEFEF',
'right-panel-tab-border': '#60606D',
'right-panel-tab-hover-bg': '#32323f',
'right-panel-tab-hover-fg': '#EFEFEF',
'right-panel-tab-selected-fg': '#EFEFEF',
'right-panel-tab-selected-bg': '#262633',
'right-panel-tab-selected-icon': '#16B378',
'right-panel-tab-button-hover-bg': '#0A5438',
'right-panel-subtab-fg': '#17B378',
'right-panel-subtab-selected-fg': '#EFEFEF',
Expand Down
15 changes: 9 additions & 6 deletions app/common/themes/GristLight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,16 @@ export const GristLight: ThemeColors = {
'left-panel-page-emoji-outline': '#BDBDBD',

/* Right Panel */
'right-panel-tab-fg': '#262633',
'right-panel-tab-bg': '#F7F7F7',
'right-panel-tab-fg': '#929299',
'right-panel-tab-bg': 'white',
'right-panel-tab-icon': '#929299',
'right-panel-tab-icon-hover': '#16B378',
'right-panel-tab-hover-bg': 'rgba(217,217,217,0.6)',
'right-panel-tab-selected-fg': '#FFFFFF',
'right-panel-tab-selected-bg': '#16B378',
'right-panel-tab-icon-hover': '#262633',
'right-panel-tab-border': 'rgba(217,217,217,0.6)',
'right-panel-tab-hover-bg': 'white',
'right-panel-tab-hover-fg': '#262633',
'right-panel-tab-selected-fg': '#262633',
'right-panel-tab-selected-bg': '#F7F7F7',
'right-panel-tab-selected-icon': '#16B378',
'right-panel-tab-button-hover-bg': '#009058',
'right-panel-subtab-fg': '#16B378',
'right-panel-subtab-selected-fg': '#262633',
Expand Down
7 changes: 6 additions & 1 deletion sandbox/gvisor/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,12 @@ def preserve(*locations, short_failure=False):
preserve("/usr/bin")

preserve("/usr/local/lib")
if os.path.exists('/lib64'):

# Do not attempt to include symlink directories, they are not supported
# and will cause obscure failures. On debian bookworm /lib64 is a
# symlink and we do not appear to need it, relative to debian buster
# where it is a real directory.
if os.path.exists('/lib64') and not os.path.islink('/lib64'):
preserve("/lib64")
if os.path.exists('/usr/lib64'):
preserve("/usr/lib64")
Expand Down
1 change: 1 addition & 0 deletions test/nbrowser/ReferenceColumns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {server, setupTestSuite} from 'test/nbrowser/testUtils';

describe('ReferenceColumns', function() {
this.timeout(20000);
gu.bigScreen();
let session: Session;
const cleanup = setupTestSuite({team: true});

Expand Down
4 changes: 2 additions & 2 deletions test/test_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
export GRIST_SESSION_COOKIE="grist_test_cookie"
export LANGUAGE="en_US"
export SE_BROWSER="chrome"
export SE_BROWSER_VERSION="130"
export SE_BROWSER_VERSION="131"
export SE_DRIVER="chrome-driver"
export SE_DRIVER_VERSION="130.0.6723.91"
export SE_DRIVER_VERSION="131.0.6778.69"
export TEST_CLEAN_DATABASE="true"
export TEST_SUPPORT_API_KEY="api_key_for_support"

Expand Down
3 changes: 3 additions & 0 deletions test/test_under_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ if [[ "${DEBUG:-}" == 1 ]]; then
GRIST_LOG_HTTP_BODY="true"
fi

set -x
docker run --name $DOCKER_CONTAINER --rm \
--env VERBOSE=${DEBUG:-} \
-p $PORT:$PORT --env PORT=$PORT \
Expand All @@ -47,7 +48,9 @@ docker run --name $DOCKER_CONTAINER --rm \
--env GRIST_LOG_HTTP_BODY=${GRIST_LOG_HTTP_BODY:-false} \
--env TEST_SUPPORT_API_KEY=api_key_for_support \
--env GRIST_TEMPLATE_ORG=templates \
${TEST_DOCKER_OPTIONS:-} \
${TEST_IMAGE:-gristlabs/grist} &
set +x

DOCKER_PID="$!"

Expand Down

0 comments on commit a205b9a

Please sign in to comment.