Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
// For format details, see https://containers.dev/implementors/json_reference/
{
    "name": "Native IOC development container",
    "image": "ghcr.io/infn-epics/infn-epics-ioc-linux-developer:latest",
    "remoteEnv": {
        // allows X11 apps to run inside the container
        "DISPLAY": "${localEnv:DISPLAY}",
        // provides a name for epics-containers to use in bash prompt etc.
        "EC_PROJECT": "${localWorkspaceFolderBasename}"
    },
    "features": {
        
    },
    // IMPORTANT for this devcontainer to work with docker EC_REMOTE_USER must be
    // set to vscode. For podman it should be left blank.
    "remoteUser": "${localEnv:EC_REMOTE_USER}",
    "customizations": {
        "vscode": {
            // Add the IDs of extensions you want installed when the container is created.
             "extensions": [
                "ms-python.python",
                "ms-python.vscode-pylance",
                "tamasfe.even-better-toml",
                "redhat.vscode-yaml",
                "ryanluker.vscode-coverage-gutters",
                "epicsdeb.vscode-epics",
                "ms-python.black-formatter"
            ]
        }
    },
    // Make sure the files we are mapping into the container exist on the host
    // You can place any other outside of the container before-launch commands here
    //"initializeCommand": "bash .devcontainer/initializeCommand ${devcontainerId}",
    // Hooks the global .bashprofile_dev_container but also can add any other commands
    // to run in the container at creation in here
    //"postCreateCommand": "bash .devcontainer/postCreateCommand ${devcontainerId}",
	// forward ports to clients
     "appPort": [5064,"5064:5064/udp","5065:5065/udp"],

    "runArgs": [
        // Allow the container to access the host X11 display and EPICS CA
        //"--net=host",
        // Make sure SELinux does not disable with access to host filesystems like tmp
        "--security-opt=label=disable"
    ],
    "workspaceMount": "source=${localWorkspaceFolder},target=/app/${localWorkspaceFolderBasename},type=bind",
    "workspaceFolder": "/app/${localWorkspaceFolderBasename}",
    "mounts": [
        // Mount some useful local files from the user's home directory
        // By mounting the parent of the workspace we can work on multiple peer projects
        "source=${localWorkspaceFolder}/../,target=/repos,type=bind",
        
        
    ]
}

...

REMOTE POD DEVELOPMENT (NEW)

It may be possible that some IOC access a network or HW that is not available locally.

...

In the following example are added three instantiated different developments podsnamed :

  1. development-andrea,

...

  1. it is constrained to run on the nodes that may access sparc-magnets network
  2. development-alessandro, it is constrained to run on the nodes that may access sparc-cams network
  3. development-gpu it is contrained to run on nodes that have a GPU
  4. development-generic it's not constrained and may run everywhere


To access a development pod simply use ssh dante@<one machine cluster address i.e 10.10.6.18> -p <ssh_nodeport>.

...

Code Block
languageyaml
titlevalues.yaml
- name: "development-andrea"
      image: "ghcr.io/infn-epics/infn-epics-ioc-developer"
      charturl: 'https://baltig.infn.it/epics-containers/ioc-chart.git'
      autosync: false ## restart automatically on changes
      devtype: development
      networks:
        - name: "control"
          annotation: "sparc-magnets"
      ssh_nodeport: 30022
      securityContext:
        runAsUser: 0
        runAsGroup: 0
    
    - name: "development-alessandro"
      image: "ghcr.io/infn-epics/infn-epics-ioc-developer"
      charturl: 'https://baltig.infn.it/epics-containers/ioc-chart.git'
      autosync: false ## restart automatically on changes
      devtype: development
      networks:
        - name: "control"
          annotation: "sparc-cams"
      ssh_nodeport: 30023
      securityContext:
        runAsUser: 0
        runAsGroup: 0

	- name: "development-gpu"
      image: "ghcr.io/infn-epics/infn-epics-ioc-developer"
      charturl: 'https://baltig.infn.it/epics-containers/ioc-chart.git'
      autosync: false ## restart automatically on changes
      devtype: development
      networksrunon:
        - name: "control"
          annotation: "gpu"
      ssh_nodeport: 30024 30029
      securityContext:
        runAsUser: 0
        runAsGroup: 0

	- name: "development-generic"
      image: "ghcr.io/infn-epics/infn-epics-ioc-developer"
      charturl: 'https://baltig.infn.it/epics-containers/ioc-chart.git'
      autosync: false ## restart automatically on changes
      devtype: development
      
      ssh_nodeport: 30028
      securityContext:
        runAsUser: 0
        runAsGroup: 0

...