epics-containers / epics-containers.github.io

Kubernetes for EPICS IOCs. Documentation for the epics-containers organization
https://epics-containers.github.io/
Apache License 2.0
15 stars 7 forks source link

Create a generic IOC tutorial steps out of order #112

Closed ulrikpedersen closed 7 months ago

ulrikpedersen commented 7 months ago

When following the tutorial to create a new Generic IOC, I find that Step number 5 does not work when running the ./build:

(ec-venv) ukp@osloxf04:~/EPICS/ioc-ads$ ./build 
++ dirname ./build
+ cd .
+ docker version
+ docker=docker
+ docker buildx version
+ builx=buildx
+ load=--load
+ '[' '!' -d ibek-support ']'
+ docker build -t ec_test --build-arg TARGET_ARCHITECTURE=linux --load --target developer .
[+] Building 0.6s (11/14)                                                                                              docker:default
 => [internal] load build definition from Dockerfile                                                                             0.0s
 => => transferring dockerfile: 1.94kB                                                                                           0.0s
 => [internal] load metadata for ghcr.io/epics-containers/epics-base-linux-developer:7.0.8ec1b3                                  0.6s
 => [internal] load .dockerignore                                                                                                0.0s
 => => transferring context: 95B                                                                                                 0.0s
 => CANCELED [developer  1/10] FROM ghcr.io/epics-containers/epics-base-linux-developer:7.0.8ec1b3@sha256:bd71072de1cf871856ba7  0.0s
 => => resolve ghcr.io/epics-containers/epics-base-linux-developer:7.0.8ec1b3@sha256:bd71072de1cf871856ba72757e97243f915ae9e346  0.0s
 => => sha256:efcb5c2c65213789596b67e29b07533ecde289e98d142aa63417f3fabf0e3db9 5.42kB / 5.42kB                                   0.0s
 => => sha256:bd71072de1cf871856ba72757e97243f915ae9e346f7f30f59604deb74bc9292 856B / 856B                                       0.0s
 => => sha256:9f5dfb61fc287f7a0ed22c8636c2e9d196c253c9e020b44114aa7c3e4fcb41df 1.63kB / 1.63kB                                   0.0s
 => [internal] load build context                                                                                                0.0s
 => => transferring context: 776B                                                                                                0.0s
 => CACHED [developer  2/10] RUN ln -s /epics/generic-source/ioc /epics/ioc                                                      0.0s
 => CACHED [developer  3/10] COPY requirements.txt requirements.txt                                                              0.0s
 => CACHED [developer  4/10] RUN pip install --upgrade -r requirements.txt                                                       0.0s
 => CACHED [developer  5/10] WORKDIR /epics/generic-source/ibek-support                                                          0.0s
 => ERROR [developer  6/10] COPY ibek-support/_global/ _global                                                                   0.0s
 => ERROR [developer  7/10] COPY ibek-support/iocStats/ iocStats                                                                 0.0s
------
 > [developer  6/10] COPY ibek-support/_global/ _global:
------
------
 > [developer  7/10] COPY ibek-support/iocStats/ iocStats:
------
Dockerfile:24
--------------------
  22 |     COPY ibek-support/_global/ _global
  23 |     
  24 | >>> COPY ibek-support/iocStats/ iocStats
  25 |     RUN iocStats/install.sh 3.2.0
  26 |     
--------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref b96f79f1-3eb5-4062-9129-3ee9c2b4b868::dgmtrashtkihbcea7atlwkvik: "/ibek-support/iocStats": not found

I think the reason is that the ibek-support git submodule has not been pulled, so the ibek-support/ directory is empty:

(ec-venv) ukp@osloxf04:~/EPICS/ioc-ads$ ls -alh ibek-support/
total 8.0K
drwxrwxr-x 2 ukp ukp 4.0K Mar 21 15:48 .
drwxrwxr-x 8 ukp ukp 4.0K Mar 21 15:48 ..
(ec-venv) ukp@osloxf04:~/EPICS/ioc-ads$ cat .gitmodules 
[submodule "ibek-support"]
    path = ibek-support
    url = https://github.com/epics-containers/ibek-support.git
(ec-venv) ukp@osloxf04:~/EPICS/ioc-ads$ 

The tutorial does contain instructions on how to pull the ibek-support submodule but only some way further down in the Prepare the ibek-support Submodule section.

ulrikpedersen commented 7 months ago

I also found that this set of instructions to prepare the ibek-support submodule didn't quite work out of the box:

cd /workspaces/ioc-lakeshore340
git submodule set-url ibek-support <PASTE *HTTPS* URL HERE>
git submodule update
cd ibek-support
git fetch
git checkout tutorial-KEEP # see note below
git remote -v # verify that the origin is your fork
cd ..

The git submodule update command didn't do anything and ibek-support was still empty. I had to do a git submodule init before the git submodule update command.

gilesknap commented 7 months ago

@marcelldls - did you encounter these problems on your recent review of the tutorials.

@ulrikpedersen I think you are right about the manual instructions.

git submodule update

should be:

git submodule update --init

Regarding the build script - that is supposed to do the same command if it sees no submodule - so something is wrong there - will look into that.

gilesknap commented 7 months ago

This was an issue with the build script check for existing submodule and is fixed in template 3.4.0 https://github.com/epics-containers/ioc-template/blob/6ea1acb82783a5362cf011f0560c50cbbc13bfcd/template/build#L27-L28