diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 15ba92a737f9ed6704698ec07091fac5ca47438e..b2d429c3dfc5d835b9b94f1436a9dfbf725240cf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,16 +1,31 @@ -image: gcr.io/kaniko-project/executor:debug - stages: - - build-and-push - -build-and-push-job: - stage: build-and-push - except: - changes: - - "**/*.yaml" - - "README.md" - + - list_volume + +variables: + KUBECONFIG: "/root/.kube/config" # Make sure the KUBECONFIG is set correctly + +before_script: + # Install kubectl and configure access to the Kubernetes cluster + - apt-get update && apt-get install -y curl + - curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" + - chmod +x ./kubectl + - mv ./kubectl /usr/local/bin/kubectl + - mkdir -p ~/.kube + - echo "$KUBECONFIG_DATA" | base64 -d > ~/.kube/config # You can store your Kubeconfig as a GitLab CI secret variable + +list_vivado_volume: + stage: list_volume + image: busybox script: - - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json - - /kaniko/executor --cache=true --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:${CI_COMMIT_SHA:0:8} --destination $CI_REGISTRY_IMAGE:latest + - echo "Creating a Kubernetes pod to list the contents of the vivado-volume..." + - kubectl apply -f pod-manifest.yaml # Create the pod with the volume mounted + - kubectl wait --for=condition=ready pod/vivado-volume-listing-pod --timeout=120s + - kubectl logs vivado-volume-listing-pod # Capture the pod's logs, which contain the directory listing + - kubectl delete pod vivado-volume-listing-pod # Clean up the pod after use + +artifacts: + paths: + - log.txt +only: + - master # Adjust to your branch preference diff --git a/Dockerfile b/Dockerfile index a900c12eba52da9c71f724ebd23b0354e2a46d38..17538f53402bea69382fa14572bb84c64d1606e7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,46 +3,5 @@ FROM ubuntu:20.04 # Set Environment Variables for Non-Interactive Installation ENV DEBIAN_FRONTEND=noninteractive -# Update Package Lists and Install 'sudo', 'tzdata', and 'locales' -RUN apt-get update && \ - apt-get install -y sudo tzdata locales - -# Set Timezone to America/New_York and Generate Locales -RUN ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime && \ - dpkg-reconfigure --frontend noninteractive tzdata && \ - locale-gen en_US.UTF-8 && \ - update-locale LANG=en_US.UTF-8 - -# Add sudoer user called 'ubuntu' -RUN useradd -m -s /bin/bash -G sudo ubuntu && \ - echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers - -# Install Required Packages -RUN apt-get update && \ - apt-get install -y \ - wget vim pciutils htop usbutils git python3 python3-pip lshw \ - ca-certificates curl gnupg apt-utils \ - zip unzip dmidecode \ - python3-yaml python3-jinja2 python3-click \ - xorg x11-apps libgpgme-dev libassuan-dev libbtrfs-dev pkg-config \ - libdevmapper-dev && \ - apt-get clean && rm -rf /var/lib/apt/lists/* - -# Switch to 'ubuntu' user and run commands -USER ubuntu -WORKDIR /home/ubuntu - -RUN git clone https://github.com/esnet/esnet-smartnic-hw.git && \ - cd esnet-smartnic-hw && \ - git checkout d3782445ce5f090ca955693a98ce68f96b68943c && \ - git submodule update --init --recursive && \ - pip3 install --user -r esnet-fpga-library/tools/regio/requirements.txt - -# Set Environment Variables -ENV LANG=en_US.UTF-8 -ENV LANGUAGE=en_US:en -ENV LC_ALL=en_US.UTF-8 -ENV XILINXD_LICENSE_FILE=2100@xilinxd.xilinx-dev - # Entry point CMD ["tail", "-f", "/dev/null"]