Major changes to support cli-end-to-end demonstration. See full log
* notes/cli-end-to-end-demo.org (Database Aquisition): Starting description for the end-to-end demonstration workflow. Very simplified version of notes/cli-end-to-end.org * docker-compose-demo.yml (services): Make the pre-populated ql database storage an explicit container to get persistent data and straightforward mount semantics. * docker-compose-demo-build.yml (services): Add a docker-compose configuration for *building* the demo environment. * demo/containers/dbsdata/Dockerfile: Add dbsdata Docker image to hold initialized minio database file tree * client/containers/vscode/README.org Update vscode container to use custom plugin for later mrva redirection
This commit is contained in:
committed by
=Michael Hohn
parent
187c49688e
commit
77ce997fbb
@@ -1,28 +0,0 @@
|
||||
all: code-server-initialized
|
||||
|
||||
CSI_TARGET := code-server-initialized:0.1.24
|
||||
csi: mk.code-server-initialized
|
||||
mk.code-server-initialized:
|
||||
docker build -t ${CSI_TARGET} .
|
||||
touch $@
|
||||
|
||||
csi-serve: csi
|
||||
docker run -d -p 9080:9080 ${CSI_TARGET}
|
||||
|
||||
clean:
|
||||
-docker rmi -f ${CSI_TARGET}
|
||||
-rm mk.code-server-initialized
|
||||
|
||||
# Targets below are used after some manual setup of the container. See README.org
|
||||
# for details
|
||||
|
||||
csi-push: mk.csi-push
|
||||
mk.csi-push: csi
|
||||
docker tag ${CSI_TARGET} ghcr.io/hohn/${CSI_TARGET}
|
||||
docker push ghcr.io/hohn/${CSI_TARGET}
|
||||
touch $@
|
||||
|
||||
csi-test:
|
||||
docker pull ghcr.io/hohn/${CSI_TARGET}
|
||||
docker run --rm -d -p 9080:9080 --name test-code-server-codeql\
|
||||
ghcr.io/hohn/${CSI_TARGET}
|
||||
@@ -1,14 +1,15 @@
|
||||
* MRVA VS Code server container
|
||||
On the host:
|
||||
|
||||
- Build the container via
|
||||
#+BEGIN_SRC sh
|
||||
make csi
|
||||
#+END_SRC
|
||||
# Build the container via
|
||||
cd ~/work-gh/mrva/mrvacommander/client/containers/vscode/
|
||||
docker build -t code-server-initialized:0.1.24 .
|
||||
|
||||
- Run the container via
|
||||
#+BEGIN_SRC sh
|
||||
make csi-serve
|
||||
# Run the container in standalone mode via
|
||||
cd ~/work-gh/mrva/mrvacommander/client/containers/vscode/
|
||||
docker run -v ~/work-gh/mrva/vscode-codeql:/work-gh/mrva/vscode-codeql \
|
||||
-d -p 9080:9080 code-server-initialized:0.1.24
|
||||
#+END_SRC
|
||||
|
||||
- Connect to it at http://localhost:9080/?folder=/home/coder, password is =mrva=.
|
||||
@@ -24,9 +25,9 @@
|
||||
codeql pack add codeql/python-all@1.0.6
|
||||
#+END_SRC
|
||||
|
||||
- Open a new file =qldemo/simple.ql= and add this this query to it. The plugin
|
||||
will download the CodeQL binaries (but never use them -- the configuration
|
||||
redirects)
|
||||
- Create a new file =qldemo/simple.ql= with this query. Open it in VS Code.
|
||||
The plugin will download the CodeQL binaries (but never use them -- the
|
||||
configuration redirects)
|
||||
#+BEGIN_SRC sh
|
||||
cd
|
||||
cat > qldemo/simple.ql <<eof
|
||||
@@ -48,29 +49,71 @@
|
||||
|
||||
- Set the database as default and run the query =simple.ql=
|
||||
|
||||
- Add the customized VS Code plugin
|
||||
On the host
|
||||
#+BEGIN_SRC sh
|
||||
cd ~/work-gh/mrva/vscode-codeql
|
||||
git checkout mrva-standalone
|
||||
|
||||
# Install nvm
|
||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
|
||||
|
||||
# Install correct node version
|
||||
cd ./extensions/ql-vscode
|
||||
nvm install
|
||||
|
||||
# Build the extension
|
||||
cd ~/work-gh/mrva/vscode-codeql/extensions/ql-vscode
|
||||
npm install
|
||||
npm run build
|
||||
#+END_SRC
|
||||
|
||||
In the container
|
||||
#+BEGIN_SRC sh
|
||||
# Install extension
|
||||
cd /work-gh/mrva/vscode-codeql/dist
|
||||
|
||||
/bin/code-server --force --install-extension vscode-codeql-*.vsix
|
||||
#+END_SRC
|
||||
|
||||
- Capture the state of this container and create a new image from it
|
||||
#+BEGIN_SRC sh
|
||||
docker ps
|
||||
docker commit 3802c3e9ad8c code-server-initialized:0.1.24
|
||||
# sha256:76cfebdd75a69bcaa8020d06fec52593bd5fde06a100c1962f3201af809bfac0
|
||||
docker kill 3802c3e9ad8c
|
||||
# Check id column. Use it below.
|
||||
docker commit 2df5732c1850 code-server-initialized:0.1.24
|
||||
# Keep the sha
|
||||
# sha256:87c8260146e28aed25b094d023a30a015a958f829c09e66cb50ccca2c4a2a000
|
||||
docker kill 2df5732c1850
|
||||
|
||||
# Make sure the image tag matches the sha
|
||||
docker inspect code-server-initialized:0.1.24 |grep Id
|
||||
# "Id": "sha256:76cfebdd75a69bcaa8020d06fec52593bd5fde06a100c1962f3201af809bfac0",
|
||||
|
||||
# Run the image and check
|
||||
docker run -d -p 9080:9080 code-server-initialized:0.1.24
|
||||
docker run --rm -d -p 9080:9080 --name test-code-server-codeql \
|
||||
code-server-initialized:0.1.24
|
||||
#+END_SRC
|
||||
Again connect to it at http://localhost:9080/?folder=/home/coder, password is =mrva=.
|
||||
|
||||
- Push this container
|
||||
#+BEGIN_SRC sh
|
||||
make csi-push
|
||||
# Common
|
||||
export CSI_TARGET=code-server-initialized:0.1.24
|
||||
|
||||
# Push container
|
||||
docker tag ${CSI_TARGET} ghcr.io/hohn/${CSI_TARGET}
|
||||
docker push ghcr.io/hohn/${CSI_TARGET}
|
||||
#+END_SRC
|
||||
|
||||
- Test the registry image
|
||||
#+BEGIN_SRC sh
|
||||
make csi-test
|
||||
# Test pushed container
|
||||
docker pull ghcr.io/hohn/${CSI_TARGET}
|
||||
docker run --rm -d -p 9080:9080 --name test-code-server-codeql\
|
||||
ghcr.io/hohn/${CSI_TARGET}
|
||||
#+END_SRC
|
||||
In the container, inside the running vs code:
|
||||
- Check the plugin version number via the command
|
||||
: codeql: copy version information
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user