Skip to content

Commit

Permalink
Merge branch 'main' into fix/friction-rand
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhoeller19 authored Oct 9, 2024
2 parents 4dea3be + d18f0c2 commit 311571d
Show file tree
Hide file tree
Showing 10 changed files with 115 additions and 24 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/mirror-buildspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 0.2

phases:
install:
runtime-versions:
nodejs: 14
pre_build:
commands:
- git config --global user.name "Isaac LAB CI Bot"
- git config --global user.email "[email protected]"
build:
commands:
- git remote set-url origin https://github.com/${TARGET_REPO}.git
- git checkout $SOURCE_BRANCH
- git push --force https://[email protected]/${TARGET_REPO}.git $SOURCE_BRANCH:$TARGET_BRANCH
46 changes: 39 additions & 7 deletions .github/workflows/postmerge-ci-buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,42 @@ version: 0.2
phases:
build:
commands:
- echo "Building a docker image"
- docker login -u \$oauthtoken -p $NGC_TOKEN nvcr.io
- docker build -t $IMAGE_NAME:latest-1.2 --build-arg ISAACSIM_VERSION_ARG=4.2.0 --build-arg ISAACSIM_ROOT_PATH_ARG=/isaac-sim --build-arg ISAACLAB_PATH_ARG=/workspace/isaaclab --build-arg DOCKER_USER_HOME_ARG=/root -f docker/Dockerfile.base .
- echo "Pushing the docker image"
- docker push $IMAGE_NAME:latest-1.2
- docker tag $IMAGE_NAME:latest-1.2 $IMAGE_NAME:latest-1.2-b$CODEBUILD_BUILD_NUMBER
- docker push $IMAGE_NAME:latest-1.2-b$CODEBUILD_BUILD_NUMBER
- echo "Building and pushing Docker image"
- |
# Determine branch name or use fallback
if [ -n "$CODEBUILD_WEBHOOK_HEAD_REF" ]; then
BRANCH_NAME=$(echo $CODEBUILD_WEBHOOK_HEAD_REF | sed 's/refs\/heads\///')
elif [ -n "$CODEBUILD_SOURCE_VERSION" ]; then
BRANCH_NAME=$CODEBUILD_SOURCE_VERSION
else
BRANCH_NAME="unknown"
fi
# Replace '/' with '-' and remove any invalid characters for Docker tag
SAFE_BRANCH_NAME=$(echo $BRANCH_NAME | sed 's/[^a-zA-Z0-9._-]/-/g')
# Use "latest" if branch name is empty or only contains invalid characters
if [ -z "$SAFE_BRANCH_NAME" ]; then
SAFE_BRANCH_NAME="latest"
fi
# Get the git repository short name
REPO_SHORT_NAME=$(basename -s .git `git config --get remote.origin.url`)
if [ -z "$REPO_SHORT_NAME" ]; then
REPO_SHORT_NAME="verification"
fi
# Combine repo short name and branch name for the tag
COMBINED_TAG="${REPO_SHORT_NAME}-${SAFE_BRANCH_NAME}"
docker login -u \$oauthtoken -p $NGC_TOKEN nvcr.io
docker build -t $IMAGE_NAME:$COMBINED_TAG \
--build-arg ISAACSIM_BASE_IMAGE_ARG=$ISAACSIM_BASE_IMAGE \
--build-arg ISAACSIM_VERSION_ARG=4.2.0 \
--build-arg ISAACSIM_ROOT_PATH_ARG=/isaac-sim \
--build-arg ISAACLAB_PATH_ARG=/workspace/isaaclab \
--build-arg DOCKER_USER_HOME_ARG=/root \
-f docker/Dockerfile.base .
docker push $IMAGE_NAME:$COMBINED_TAG
docker tag $IMAGE_NAME:$COMBINED_TAG $IMAGE_NAME:$COMBINED_TAG-b$CODEBUILD_BUILD_NUMBER
docker push $IMAGE_NAME:$COMBINED_TAG-b$CODEBUILD_BUILD_NUMBER
52 changes: 43 additions & 9 deletions .github/workflows/premerge-ci-buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,39 @@ phases:
pre_build:
commands:
- echo "Launching EC2 instance to run tests"
- INSTANCE_ID=$(aws ec2 run-instances --image-id ami-0f7f7fb14ee15d5ae --count 1 --instance-type g5.2xlarge --key-name production/ssh/isaaclab --security-group-ids sg-02617e4b8916794c4 --subnet-id subnet-0907ceaeb40fd9eac --block-device-mappings 'DeviceName=/dev/sda1,Ebs={VolumeSize=500}' --output text --query 'Instances[0].InstanceId')
- |
INSTANCE_ID=$(aws ec2 run-instances \
--image-id ami-0b3a9d48380433e49 \
--count 1 \
--instance-type g5.2xlarge \
--key-name production/ssh/isaaclab \
--security-group-ids sg-02617e4b8916794c4 \
--subnet-id subnet-0907ceaeb40fd9eac \
--block-device-mappings '[{"DeviceName":"/dev/sda1","Ebs":{"VolumeSize":500}}]' \
--output text \
--query 'Instances[0].InstanceId')
- aws ec2 wait instance-running --instance-ids $INSTANCE_ID
- EC2_INSTANCE_IP=$(aws ec2 describe-instances --filters "Name=instance-state-name,Values=running" "Name=instance-id,Values=$INSTANCE_ID" --query 'Reservations[*].Instances[*].[PrivateIpAddress]' --output text)
- |
EC2_INSTANCE_IP=$(aws ec2 describe-instances \
--filters "Name=instance-state-name,Values=running" "Name=instance-id,Values=$INSTANCE_ID" \
--query 'Reservations[*].Instances[*].[PrivateIpAddress]' \
--output text)
- mkdir -p ~/.ssh
- aws ec2 describe-key-pairs --include-public-key --key-name production/ssh/isaaclab --query 'KeyPairs[0].PublicKey' --output text > ~/.ssh/id_rsa.pub
- aws secretsmanager get-secret-value --secret-id production/ssh/isaaclab --query SecretString --output text > ~/.ssh/id_rsa
- |
aws ec2 describe-key-pairs --include-public-key --key-name production/ssh/isaaclab \
--query 'KeyPairs[0].PublicKey' --output text > ~/.ssh/id_rsa.pub
- |
aws secretsmanager get-secret-value --secret-id production/ssh/isaaclab \
--query SecretString --output text > ~/.ssh/id_rsa
- chmod 400 ~/.ssh/id_*
- echo "Host $EC2_INSTANCE_IP\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- aws ec2-instance-connect send-ssh-public-key --instance-id $INSTANCE_ID --availability-zone us-west-2a --ssh-public-key file://~/.ssh/id_rsa.pub --instance-os-user ubuntu
- |
aws ec2-instance-connect send-ssh-public-key \
--instance-id $INSTANCE_ID \
--availability-zone us-west-2a \
--ssh-public-key file://~/.ssh/id_rsa.pub \
--instance-os-user ubuntu
build:
commands:
- echo "Running tests on EC2 instance"
Expand Down Expand Up @@ -40,10 +64,20 @@ phases:
retry_scp
'
- ssh ubuntu@$EC2_INSTANCE_IP "docker login -u \\\$oauthtoken -p $NGC_TOKEN nvcr.io"
- ssh ubuntu@$EC2_INSTANCE_IP "cd $SRC_DIR;
DOCKER_BUILDKIT=1 docker build -t isaac-lab-dev --build-arg ISAACSIM_VERSION_ARG=4.2.0 --build-arg ISAACSIM_ROOT_PATH_ARG=/isaac-sim --build-arg ISAACLAB_PATH_ARG=/workspace/isaaclab --build-arg DOCKER_USER_HOME_ARG=/root -f docker/Dockerfile.base . ;
docker run --rm --entrypoint bash --gpus all --network=host --name isaac-lab-test isaac-lab-dev ./isaaclab.sh -t &&
exit $?"
- |
ssh ubuntu@$EC2_INSTANCE_IP "
cd $SRC_DIR
DOCKER_BUILDKIT=1 docker build -t isaac-lab-dev \
--build-arg ISAACSIM_BASE_IMAGE_ARG=$ISAACSIM_BASE_IMAGE \
--build-arg ISAACSIM_VERSION_ARG=4.2.0 \
--build-arg ISAACSIM_ROOT_PATH_ARG=/isaac-sim \
--build-arg ISAACLAB_PATH_ARG=/workspace/isaaclab \
--build-arg DOCKER_USER_HOME_ARG=/root \
-f docker/Dockerfile.base .
docker run --rm --entrypoint bash --gpus all --network=host \
--name isaac-lab-test isaac-lab-dev ./isaaclab.sh -t && exit \$?
"
post_build:
commands:
- echo "Terminating EC2 instance"
Expand Down
2 changes: 2 additions & 0 deletions docker/.env.base
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

# Accept the NVIDIA Omniverse EULA by default
ACCEPT_EULA=Y
# NVIDIA Isaac Sim base image
ISAACSIM_BASE_IMAGE=nvcr.io/nvidia/isaac-sim
# NVIDIA Isaac Sim version to use (e.g. 4.2.0)
ISAACSIM_VERSION=4.2.0
# Derived from the default path in the NVIDIA provided Isaac Sim container
Expand Down
3 changes: 2 additions & 1 deletion docker/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
# Please check above link for license information.

# Base image
ARG ISAACSIM_BASE_IMAGE_ARG
ARG ISAACSIM_VERSION_ARG
FROM nvcr.io/nvidia/isaac-sim:${ISAACSIM_VERSION_ARG} AS base
FROM ${ISAACSIM_BASE_IMAGE_ARG}:${ISAACSIM_VERSION_ARG} AS base
ENV ISAACSIM_VERSION=${ISAACSIM_VERSION_ARG}

# Set default RUN shell to bash
Expand Down
1 change: 1 addition & 0 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ services:
context: ../
dockerfile: docker/Dockerfile.base
args:
- ISAACSIM_BASE_IMAGE_ARG=${ISAACSIM_BASE_IMAGE}
- ISAACSIM_VERSION_ARG=${ISAACSIM_VERSION}
- ISAACSIM_ROOT_PATH_ARG=${DOCKER_ISAACSIM_ROOT_PATH}
- ISAACLAB_PATH_ARG=${DOCKER_ISAACLAB_PATH}
Expand Down
4 changes: 2 additions & 2 deletions docs/source/overview/environments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ Classic environments that are based on IsaacGymEnvs implementation of MuJoCo-sty
.. |humanoid-link| replace:: `Isaac-Humanoid-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/manager_based/classic/humanoid/humanoid_env_cfg.py>`__
.. |ant-link| replace:: `Isaac-Ant-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/manager_based/classic/ant/ant_env_cfg.py>`__
.. |cartpole-link| replace:: `Isaac-Cartpole-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/manager_based/classic/cartpole/cartpole_env_cfg.py>`__
.. |cartpole-rgb-link| replace:: `Isaac-Cartpole-RGB-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/manager_based/classic/cartpole/cartpole_camera_env_cfg.py>`__
.. |cartpole-depth-link| replace:: `Isaac-Cartpole-Depth-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/manager_based/classic/cartpole/cartpole_camera_env_cfg.py>`__
.. |cartpole-rgb-link| replace:: `Isaac-Cartpole-RGB-Camera-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/manager_based/classic/cartpole/cartpole_camera_env_cfg.py>`__
.. |cartpole-depth-link| replace:: `Isaac-Cartpole-Depth-Camera-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/manager_based/classic/cartpole/cartpole_camera_env_cfg.py>`__

.. |humanoid-direct-link| replace:: `Isaac-Humanoid-Direct-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/direct/humanoid/humanoid_env.py>`__
.. |ant-direct-link| replace:: `Isaac-Ant-Direct-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/direct/ant/ant_env.py>`__
Expand Down
2 changes: 1 addition & 1 deletion isaaclab.bat
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ if errorlevel 1 (
set isaacsim_exe=!isaac_path!\isaac-sim.bat
) else (
rem if isaac sim installed from pip
set isaacsim_exe=isaacsim
set isaacsim_exe=isaacsim omni.isaac.sim
)
rem check if there is a python path available
if not exist "%isaacsim_exe%" (
Expand Down
10 changes: 8 additions & 2 deletions isaaclab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,14 @@ extract_isaacsim_exe() {
local isaacsim_exe=${isaac_path}/isaac-sim.sh
# check if there is a python path available
if [ ! -f "${isaacsim_exe}" ]; then
echo "[ERROR] No Isaac Sim executable found at path: ${isaacsim_exe}" >&2
exit 1
# check for installation using Isaac Sim pip
if [ $(python -m pip list | grep -c 'isaacsim-rl') -gt 0 ]; then
# Isaac Sim - Python packages entry point
local isaacsim_exe="isaacsim omni.isaac.sim"
else
echo "[ERROR] No Isaac Sim executable found at path: ${isaac_path}" >&2
exit 1
fi
fi
# return the result
echo ${isaacsim_exe}
Expand Down
4 changes: 2 additions & 2 deletions tools/run_all_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,14 @@ def test_all(
else:
stdout_str = stdout.decode("utf-8")
else:
stdout = ""
stdout_str = ""
if stderr is not None:
if isinstance(stderr, str):
stderr_str = stderr
else:
stderr_str = stderr.decode("utf-8")
else:
stderr = ""
stderr_str = ""

# Write to log file
logging.info(stdout_str)
Expand Down

0 comments on commit 311571d

Please sign in to comment.