Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions azure-pipelines/azure-pipelines-viseron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,6 @@ stages:
docker manifest inspect roflcoopter/viseron:${release_version}
}

echo "Pulling architecture-specific images for version $(viseronVersion)"
docker pull roflcoopter/amd64-viseron:$(viseronVersion)
docker pull roflcoopter/rpi3-viseron:$(viseronVersion)
docker pull roflcoopter/aarch64-viseron:$(viseronVersion)

# Create version tag
echo "Creating and pushing multi-arch manifest for $(viseronVersion)"
create_manifest $(viseronVersion)
Expand Down
15 changes: 13 additions & 2 deletions azure-pipelines/docker-compose-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,17 @@ services:
bash -c "vulture viseron/"
user: 1000:1000

amd64-azure-agent:
build:
context: ..
dockerfile: ./docker/Dockerfile.azure
args:
TARGETARCH: "amd64"
UBUNTU_VERSION: "$UBUNTU_VERSION"
cache_from:
- roflcoopter/amd64-azure-agent:latest
image: roflcoopter/amd64-azure-agent:latest

################ amd64 CUDA ###################################
amd64-cuda-ffmpeg:
build:
Expand Down Expand Up @@ -690,9 +701,9 @@ services:
rpi5-azure-agent:
build:
context: ..
dockerfile: ./docker/rpi5/Dockerfile.azure
dockerfile: ./docker/Dockerfile.azure
args:
TARGETARCH: "linux-arm64"
TARGETARCH: "arm64"
UBUNTU_VERSION: "$UBUNTU_VERSION"
cache_from:
- roflcoopter/rpi5-azure-agent:latest
Expand Down
6 changes: 3 additions & 3 deletions azure-pipelines/templates/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
${{ if or(eq(architecture, 'aarch64'), eq(architecture, 'jetson-nano'), eq(architecture, 'rpi5')) }}:
name: rpi5
${{ else }}:
vmImage: ubuntu-latest
name: amd64
steps:
- template: release_version.yaml
parameters:
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
--build-arg BUILDKIT_INLINE_CACHE=1
--build-arg VISERON_VERSION=$(viseronVersion)
--build-arg VISERON_GIT_COMMIT=$(Build.SourceVersion)
--build-arg NODE_OPTIONS="--max-old-space-size=4096"
--build-arg NODE_OPTIONS="--max-old-space-size=2048"
${{ architecture }}-${{ parameters.image }}
displayName: Build ${{ architecture }}-${{ parameters.image }}
condition: and(succeeded(), eq('${{ parameters.imageNameOnly }}', false))
Expand All @@ -96,7 +96,7 @@ jobs:
--build-arg BUILDKIT_INLINE_CACHE=1
--build-arg VISERON_VERSION=$(viseronVersion)
--build-arg VISERON_GIT_COMMIT=$(Build.SourceVersion)
--build-arg NODE_OPTIONS="--max-old-space-size=4096"
--build-arg NODE_OPTIONS="--max-old-space-size=2048"
${{ parameters.image }}
displayName: Build ${{ parameters.image }}
condition: and(succeeded(), eq('${{ parameters.imageNameOnly }}', true))
Expand Down
13 changes: 12 additions & 1 deletion azure-pipelines/templates/cleanup.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,29 @@
steps:
- script: |
df -h
displayName: List free space before cleaning
FREE_GB=$(df -BG --output=avail / | tail -1 | tr -d ' G')
echo "Free space: ${FREE_GB}GB"
if [ "${FREE_GB}" -lt 20 ]; then
echo "##vso[task.setvariable variable=needsCleanup]true"
else
echo "##vso[task.setvariable variable=needsCleanup]false"
fi
displayName: Check free space
- script: |
docker rmi -f $(docker images -aq) || true
displayName: Clean up Docker images
condition: eq(variables.needsCleanup, 'true')
- script: |
docker system prune --force --all --volumes || true
displayName: Docker prune
condition: eq(variables.needsCleanup, 'true')
- script: |
sudo rm -rf /usr/local/lib/android || true
sudo rm -rf /usr/local/.ghcup || true
sudo rm -rf /opt/hostedtoolcache/CodeQL || true
displayName: Remove unused files
condition: eq(variables.needsCleanup, 'true')
- script: |
df -h
displayName: List free space after cleaning
condition: eq(variables.needsCleanup, 'true')
21 changes: 13 additions & 8 deletions docker/rpi5/Dockerfile.azure → docker/Dockerfile.azure
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
ARG UBUNTU_VERSION
FROM ubuntu:${UBUNTU_VERSION}
ENV TARGETARCH="linux-arm64" \
DOCKER_BUILDKIT=1
ENV DOCKER_BUILDKIT=1

ARG DOCKER_GID
ARG TARGETARCH
ENV TARGETARCH=${TARGETARCH}
RUN echo "Building for architecture: ${TARGETARCH}"

RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y curl git jq libicu70 ca-certificates curl

# Install Docker
# Install Docker CLI and plugins
RUN \
install -m 0755 -d /etc/apt/keyrings && \
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc && \
Expand All @@ -29,14 +30,18 @@ RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash

WORKDIR /azp/

COPY ./docker/azure-agent-start.sh ./
RUN chmod +x ./azure-agent-start.sh
COPY ./docker/azure-agent-start.sh /usr/local/bin/azure-agent-start.sh
RUN chmod +x /usr/local/bin/azure-agent-start.sh

# Create agent user and set up home directory
RUN useradd -m -d /home/agent agent
RUN chown -R agent:agent /azp /home/agent
RUN groupadd -g ${DOCKER_GID} docker && usermod -aG docker agent

# Configure Docker CLI to connect to DinD sidecar over TLS
ENV DOCKER_HOST=tcp://docker:2376 \
DOCKER_TLS_VERIFY=1 \
DOCKER_CERT_PATH=/certs/client

USER agent

ENTRYPOINT [ "./azure-agent-start.sh" ]
ENTRYPOINT [ "/usr/local/bin/azure-agent-start.sh" ]
9 changes: 8 additions & 1 deletion docker/azure-agent-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,17 @@ export VSO_AGENT_IGNORE="AZP_TOKEN,AZP_TOKEN_FILE"

print_header "1. Determining matching Azure Pipelines agent..."

case "${TARGETARCH}" in
amd64) AZP_AGENT_PLATFORM="linux-x64" ;;
arm64) AZP_AGENT_PLATFORM="linux-arm64" ;;
arm) AZP_AGENT_PLATFORM="linux-arm" ;;
*) echo 1>&2 "error: unsupported architecture: ${TARGETARCH}"; exit 1 ;;
esac

AZP_AGENT_PACKAGES=$(curl -LsS \
-u user:$(cat "${AZP_TOKEN_FILE}") \
-H "Accept:application/json" \
"${AZP_URL}/_apis/distributedtask/packages/agent?platform=${TARGETARCH}&top=1")
"${AZP_URL}/_apis/distributedtask/packages/agent?platform=${AZP_AGENT_PLATFORM}&top=1")

AZP_AGENT_PACKAGE_LATEST_URL=$(echo "${AZP_AGENT_PACKAGES}" | jq -r ".value[0].downloadUrl")

Expand Down
4 changes: 2 additions & 2 deletions frontend/src/lib/helpers/dates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ export function getDayjsFromDateString(dateString: string) {
// Supports both seconds and milliseconds
// Milliseconds are converted to seconds
export function getDayjsFromUnixTimestamp(timestamp: number) {
if (timestamp.toString().length === 13) {
if (Math.abs(timestamp) > 9999999999) {
timestamp = Math.floor(timestamp / 1000);
}
return dayjs.unix(timestamp).tz();
return dayjs.unix(Math.round(timestamp)).tz();
Comment on lines +58 to +61
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getDayjsFromUnixTimestamp now rounds the timestamp to whole seconds (Math.round(timestamp)), which changes behavior for callers that pass fractional seconds (e.g. cursor/time interpolation) and can shift times forward/back by up to 1s. Consider preserving sub-second precision by passing the (possibly divided-by-1000) value through unchanged, or if integer seconds are required use truncation (Math.trunc) rather than rounding to avoid time drift.

Copilot uses AI. Check for mistakes.
}

// Format a dayjs instance to a time string HH:mm:ss or HH:mm
Expand Down
Loading