mirror of https://github.com/apache/superset.git
fix(docker): error around missing requirements/base.txt (#27608)
This commit is contained in:
parent
6e528426dd
commit
6f3afab01d
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "supersetbot",
|
||||
"version": "0.4.1",
|
||||
"version": "0.4.2",
|
||||
"description": "A bot for the Superset GitHub repo",
|
||||
"type": "module",
|
||||
"main": "src/index.js",
|
||||
|
|
|
@ -154,16 +154,16 @@ export default function getCLI(context) {
|
|||
|
||||
program.command('docker')
|
||||
.description('Generates/run docker build commands use in CI')
|
||||
.option('-t, --preset', 'Build preset', /^(lean|dev|dockerize|websocket|py310|ci)$/i, 'lean')
|
||||
.option('-t, --preset <preset>', 'Build preset', /^(lean|dev|dockerize|websocket|py310|ci)$/i, 'lean')
|
||||
.option('-c, --context <context>', 'Build context', /^(push|pull_request|release)$/i, 'local')
|
||||
.option('-r, --context-ref <ref>', 'Reference to the PR, release, or branch')
|
||||
.option('-p, --platform <platform...>', 'Platforms (multiple values allowed)')
|
||||
.option('-f, --force-latest', 'Force the "latest" tag on the release')
|
||||
.option('-v, --verbose', 'Print more info')
|
||||
.action(function (preset) {
|
||||
const opts = context.processOptions(this);
|
||||
.action(function () {
|
||||
const opts = context.processOptions(this, ['preset']);
|
||||
opts.platform = opts.platform || ['linux/arm64'];
|
||||
const cmd = docker.getDockerCommand({ preset, ...opts });
|
||||
const cmd = docker.getDockerCommand({ ...opts });
|
||||
context.log(cmd);
|
||||
if (!opts.dryRun) {
|
||||
utils.runShellCommand(cmd, false);
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
import { spawnSync } from 'child_process';
|
||||
|
||||
describe('CLI Test', () => {
|
||||
test.each([
|
||||
['./src/supersetbot', ['docker', '--preset', 'dev', '--dry-run'], '--target dev'],
|
||||
['./src/supersetbot', ['docker', '--dry-run'], '--target lean'],
|
||||
])('returns %s for release %s', (command, arg, contains) => {
|
||||
const result = spawnSync(command, arg);
|
||||
const output = result.stdout.toString();
|
||||
expect(result.stdout.toString()).toContain(contains);
|
||||
});
|
||||
});
|
11
Dockerfile
11
Dockerfile
|
@ -61,7 +61,7 @@ ENV LANG=C.UTF-8 \
|
|||
SUPERSET_HOME="/app/superset_home" \
|
||||
SUPERSET_PORT=8088
|
||||
|
||||
RUN mkdir -p ${PYTHONPATH} superset/static superset-frontend apache_superset.egg-info requirements \
|
||||
RUN mkdir -p ${PYTHONPATH} superset/static requirements superset-frontend apache_superset.egg-info requirements \
|
||||
&& useradd --user-group -d ${SUPERSET_HOME} -m --no-log-init --shell /bin/bash superset \
|
||||
&& apt-get update -qq && apt-get install -yqq --no-install-recommends \
|
||||
build-essential \
|
||||
|
@ -79,8 +79,8 @@ RUN mkdir -p ${PYTHONPATH} superset/static superset-frontend apache_superset.egg
|
|||
COPY --chown=superset:superset setup.py MANIFEST.in README.md ./
|
||||
# setup.py uses the version information in package.json
|
||||
COPY --chown=superset:superset superset-frontend/package.json superset-frontend/
|
||||
RUN --mount=type=bind,target=./requirements/base.txt,src=./requirements/base.txt \
|
||||
--mount=type=cache,target=/root/.cache/pip \
|
||||
COPY --chown=superset:superset requirements/base.txt requirements/
|
||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||
pip install --upgrade setuptools pip && \
|
||||
pip install -r requirements/base.txt
|
||||
|
||||
|
@ -126,8 +126,9 @@ RUN apt-get update -qq \
|
|||
&& ln -s /opt/firefox/firefox /usr/local/bin/firefox \
|
||||
&& apt-get autoremove -yqq --purge wget && rm -rf /var/[log,tmp]/* /tmp/* /var/lib/apt/lists/*
|
||||
# Cache everything for dev purposes...
|
||||
RUN --mount=type=bind,target=./requirements/development.txt,src=./requirements/development.txt \
|
||||
--mount=type=cache,target=/root/.cache/pip \
|
||||
|
||||
COPY --chown=superset:superset requirements/development.txt requirements/
|
||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||
pip install -r requirements/development.txt
|
||||
|
||||
USER superset
|
||||
|
|
Loading…
Reference in New Issue